Jump to content

Esthetic numbers: Difference between revisions

m
m (J: more sensible definition for 'graph')
Line 3,048:
(Result e not displayed here -- it's the same as <tt>next^:8]1</tt> below.)
 
But, itIt's much more efficient to generate sequences of digits from a base digit, rather than generating sequential integers and discarding those which are not suitable.
 
For example, can generate a directed graph, from one digit to the one or two viable adjacent digits, and then build up a result based on all viable values of the rightmost digit of the current list of partially built candidates:
Line 3,055:
next=: [:; (0 10#.],.graph {::"0 1~10|])each
 
next^:3]1
1010 1012 1210 1212 1232 1234
14 9$next^:8]1
101010101 101010121 101010123 101012101 101012121 101012123 101012321 101012323 101012343
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.