# Is there a known algorithm for computing the n-th Turing machine directly? [duplicate]

Let us define a Turing machine by a machine description that is a string of symbols produced by some numerical encoding. For example, a Turing machine $M_1$ can be represented by 9,900,599 ([0 0 halt], where halt = 5 and the start and end of an instruction is 99). A standard enumeration consists of all possible Turing machines.

If given a number $n$, is there a known algorithm out there for producing the $n$th Turing machine ($M_n$) in the standard enumeration?

## marked as duplicate by Yuval Filmus algorithms StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 5 '17 at 9:19

Generate all strings in order, and keep track of which of them correspond to valid encodings. One you have seen the $n$th one, output it.