login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A165300 a(n) = smallest number not already present that permits the cyclic repetition of the path 1,2 of the digits in the sequence. 7
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

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). [From John W. Layman, Sep 22 2009]

LINKS

Table of n, a(n) for n=1..25.

FORMULA

a(n+1)=(1/24)*((a(n)+10^floor(1+log10(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(log10(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. [From Paolo P. Lava, Oct 02 2009]

EXAMPLE

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.

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); [From Paolo P. Lava, Oct 02 2009]

CROSSREFS

A165301-A165307

Sequence in context: A138534 A062080 A221279 * A028359 A034524 A051782

Adjacent sequences:  A165297 A165298 A165299 * A165301 A165302 A165303

KEYWORD

easy,base,nonn

AUTHOR

Paolo P. Lava and Giorgio Balzarotti, Sep 14 2009

EXTENSIONS

Terms a(21) onward from John W. Layman, Sep 22 2009

Edited by N. J. A. Sloane, Oct 06 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 22 15:52 EST 2019. Contains 320399 sequences. (Running on oeis4.)