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.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 34, 56, 78, 91, 23, 45, 67, 89, 123, 456, 789, 1234, 567, 891, 234, 5678, 912, 345, 678, 9123, 4567, 8912, 3456, 7891, 2345, 6789, 12345, 67891, 23456, 78912, 34567, 89123, 45678, 91234, 56789, 123456, 789123, 456789, 1234567
Offset: 1
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.
Cf.
A081549 (strictly increasing version).
-
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 *)
-
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
A165304
a(n) is the smallest number not already in the sequence, such that the concatenation of all a(n) displays the periodic digit string 1, 2, 3, 4, 5, 6 (and repeat).
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 12, 34, 56, 123, 45, 61, 23, 456, 1234, 561, 234, 5612, 345, 612, 3456, 12345, 6123, 4561, 2345, 61234, 56123, 45612, 34561, 23456, 123456, 1234561, 234561, 2345612, 345612, 3456123, 456123, 4561234, 561234, 5612345, 612345, 6123456, 12345612
Offset: 1
Starting from 1, 2, 3, 4, 5, 6, the next number must be 12 because the leading digit must be a 1. But 1 is already in the sequence so we need to attach a 2 -> 12.
-
cyc6 := proc(n) op(n,[2,3,4,5,6,1]) ; end:
A165304 := proc(n) option remember ; local k,prev,d,a ; if n = 1 then 1; else d := cyc6(procname(n-1) mod 10) ; a := d ; while true do prev := false; for k from 1 to n-1 do if procname(k) = a then prev := true; break; end if; end do; if not prev then return a; end if; d := cyc6(d) ; a := 10*a+d ; end do; end if ; end proc:
seq(A165304(n),n=1..60) ; # R. J. Mathar, Oct 16 2009
Keyword:base added, sequence extended by
R. J. Mathar, Oct 16 2009
A165306
a(n) is the smallest number not yet in the sequence such that concatenation of all terms yields an infinite periodic stream of digits 1, 2, 3, ..., 8 (repeat from 1).
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 12, 34, 56, 78, 123, 45, 67, 81, 23, 456, 781, 234, 567, 812, 345, 678, 1234, 5678, 12345, 6781, 2345, 67812, 3456, 7812, 34567, 8123, 4567, 81234, 56781, 23456, 78123, 45678, 123456, 781234, 567812, 345678, 1234567, 812345
Offset: 1
Considering a(9), having already 1,2,3,4,5,6,7,8, the next number must be 12 because after 1,2,3,4,5,6,7,8 we shall continue with a 1.
But 1 is already in the sequence so we need to add a 2 -> 12. And so on.
-
cyc8 := proc(n) op(n, [2, 3, 4, 5, 6, 7, 8, 1]) ; end:
A165306 := proc(n) option remember ; local k, prev, d, a ; if n = 1 then 1; else d := cyc8(procname(n-1) mod 10) ; a := d ; while true do prev := false; for k from 1 to n-1 do if procname(k) = a then prev := true; break; end if; end do; if not prev then return a; end if; d := cyc8(d) ; a := 10*a+d ; end do; end if ; end proc:
seq(A165306(n), n=1..60) ; # R. J. Mathar, Feb 02 2010
Showing 1-3 of 3 results.
Comments