This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A165307 #12 Aug 16 2015 22:00:48 %S A165307 1,2,3,4,5,6,7,8,9,12,34,56,78,91,23,45,67,89,123,456,789,1234,567, %T A165307 891,234,5678,912,345,678,9123,4567,8912,3456,7891,2345,6789,12345, %U A165307 67891,23456,78912,34567,89123,45678,91234,56789,123456,789123,456789,1234567 %N A165307 Minimum number n, not already present, that permits the cyclic repetition of the decimal digits 1,2,3,4,5,6,7,8,9 in the sequence. %C A165307 This sequence has a nice graph. - _M. F. Hasler_, Aug 16 2015 %H A165307 Ivan Neretin, <a href="/A165307/b165307.txt">Table of n, a(n) for n = 1..500</a> %e A165307 Starting from 1,2,3,4,5,6,7,8,9 the next number is 12 because after 1,2,3,4,5,6,7,8,9 we must continue with a digit '1'. But 1 is already in the sequence so we need to append a 2, which yields 12. And so on. %t A165307 a = {1}; c = 0; Do[c = 10 c + Mod[n, 9] + 1; If[! MemberQ[a, c], AppendTo[a, c]; c = 0], {n, 160}]; a (* _Ivan Neretin_, Aug 14 2015 *) %o A165307 (PARI) a(n,show=0,u=[],d=[1,1])={my(s(d)=Strchr(vectorsmall(d[1],i,(d[2]-2+i)%9+49)));while(n--,show&&print1(s(d)",");u=setunion(u,[d]);#u>9 && u[10]==[u[1][1]+1,1] && u=u[10..-1];d=(d[1]+d[2]-1)%9+1;for(nd=u[1][1],9e9,if(!setsearch(u,[nd,d]),d=[nd,d];next(2))));eval(s(d))} \\ _M. F. Hasler_, Aug 16 2015 %Y A165307 Cf. A165300, A165301, A165302, A165303, A165304, A165305, A165306. %Y A165307 Cf. A081549 (strictly increasing version). %K A165307 easy,nonn,base,look %O A165307 1,2 %A A165307 _Paolo P. Lava_ and _Giorgio Balzarotti_, Sep 14 2009 %E A165307 Edited by _Charles R Greathouse IV_, Aug 03 2010