cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

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

Views

Author

Keywords

Comments

This sequence has a nice graph. - M. F. Hasler, Aug 16 2015

Examples

			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.
		

Crossrefs

Cf. A081549 (strictly increasing version).

Programs

  • Mathematica
    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 *)
  • 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

Extensions

Edited by Charles R Greathouse IV, Aug 03 2010

A165300 a(n) is the smallest number not already present that permits the cyclic repetition of the path 1,2 of the digits in the sequence.

Original entry on oeis.org

1, 2, 12, 121, 21, 212, 1212, 12121, 2121, 21212, 121212, 1212121, 212121, 2121212, 12121212, 121212121, 21212121, 212121212, 1212121212, 12121212121, 2121212121, 21212121212, 121212121212, 1212121212121, 212121212121
Offset: 1

Views

Author

Keywords

Comments

Conjecture. (1) If n > 1, and a(n) begins and ends with 1, then a(n+1) is obtained by deleting the initial 1 of a(n); (2) if a(n) begins with 1 and ends with 2 then a(n+1) is obtained by adding a final 1 to a(n); (3) if a(n) begins with 2 and ends with 1 then a(n+1) is obtained by adding a final 2 to a(n); (4) if a(n) begins and ends with 2 then a(n+1) is obtained by adding an initial 1 to a(n). This has been confirmed through a(140), which has 71 digits (and should be fairly easy to prove). - John W. Layman, Sep 22 2009

Examples

			Starting from 1,2 the next number must be 12 because after 1,2 we shall continue with a 1. But 1 is already in the sequence so we need to add a 2 -> 12. And so on.
		

Crossrefs

Programs

  • Maple
    P:=proc(i) local a,n; a:=2; print(1);print(2); for n from 3 by 1 to i do a:=1/24*((a+10^floor(1+evalf(log10(a),100)))*(((n-2) mod 4)+((n-1) mod 4)+7*(n mod 4)-5*((n+1) mod 4))+(10*a+1)*(((n-2) mod 4)+7*((n-1) mod 4)-5*(n mod 4)+((n+1) mod 4))+(a-10^floor(evalf(log10(a),100)))*(7*((n-2) mod 4)-5*((n-1) mod 4)+(n mod 4)+((n+1) mod 4))+(10*a+2)*(-5*((n-2) mod 4)+((n-1) mod 4)+(n mod 4)+7*((n+1) mod 4))); print(a); od; end: P(200); # Paolo P. Lava, Oct 02 2009

Formula

a(n+1) = (1/24)*((a(n) + 10^floor(1 + log_10(a(n))))*(((n-2) mod 4) + ((n-1) mod 4) + 7*(n mod 4) - 5*((n+1) mod 4)) + (10*a(n)+1)*(((n-2) mod 4) + 7*((n-1) mod 4) - 5*(n mod 4) + ((n+1) mod 4)) + (a(n) - 10^floor(log_10(a(n))))*(7*((n-2) mod 4) - 5*((n-1) mod 4) + (n mod 4) + ((n+1) mod 4)) + (10*a(n) + 2)*(-5*((n-2) mod 4) + ((n-1) mod 4) + (n mod 4) + 7*((n+1) mod 4))), with n >= 3 and a(1)=1, a(2)=2. - Paolo P. Lava, Oct 02 2009

Extensions

Terms a(21) onward from John W. Layman, Sep 22 2009
Edited by N. J. A. Sloane, Oct 06 2009

A165302 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 (and repeat).

Original entry on oeis.org

1, 2, 3, 4, 12, 34, 123, 41, 23, 412, 341, 234, 1234, 12341, 2341, 23412, 3412, 34123, 4123, 41234, 123412, 341234, 1234123, 412341, 234123, 4123412, 3412341, 2341234, 12341234, 123412341, 23412341, 234123412, 34123412, 341234123, 41234123, 412341234
Offset: 1

Views

Author

Keywords

Examples

			Starting from 1, 2, 3, 4, the next number must be 12 because we need to continue with a 1. But 1 is already in the sequence so we need to attach a 2 -> 12. And so on.
		

Crossrefs

Programs

  • Maple
    cyc4 := proc(n) op(n,[2,3,4,1]) ; end:
    A165302 := proc(n) option remember ; local k,prev,d,a ; if n = 1 then 1; else d := cyc4(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 := cyc4(d) ; a := 10*a+d ; end do; end if ; end proc:
    seq(A165302(n),n=1..60) ; # R. J. Mathar, Oct 16 2009

Extensions

Keyword:base added, sequence extended by R. J. Mathar, Oct 16 2009
Showing 1-3 of 3 results.