The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A165301 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 (and repeat). 4
1, 2, 3, 12, 31, 23, 123, 1231, 231, 2312, 312, 3123, 12312, 31231, 23123, 123123, 1231231, 231231, 2312312, 312312, 3123123, 12312312, 31231231, 23123123, 123123123, 1231231231, 231231231, 2312312312, 312312312, 3123123123, 12312312312, 31231231231 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
Starting from 1, 2, 3, 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.
MAPLE
cyc3 := proc(n) op(n, [2, 3, 1]) ; end:
A165301 := proc(n) option remember ; local k, prev, d, a ; if n = 1 then 1; else d := cyc3(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 := cyc3(d) ; a := 10*a+d ; end do; end if ; end proc:
seq(A165301(n), n=1..60) ; # R. J. Mathar, Oct 16 2009
CROSSREFS
Sequence in context: A073617 A034381 A076424 * A072440 A135522 A353831
KEYWORD
easy,base,nonn
AUTHOR
EXTENSIONS
Keyword:base added, sequence extended by R. J. Mathar, Oct 16 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 14 20:39 EDT 2024. Contains 372533 sequences. (Running on oeis4.)