Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A165302
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
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). +0
3
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 (list; graph; listen)
OFFSET

1,2

EXAMPLE

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.

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

CROSSREFS

A165300, A165301, A165303-A165307

Sequence in context: A059810 A037397 A053350 this_sequence A117342 A123215 A126129

Adjacent sequences: A165299 A165300 A165301 this_sequence A165303 A165304 A165305

KEYWORD

easy,base,nonn

AUTHOR

Paolo P. Lava & Giorgio Balzarotti (ppl(AT)spl.at), Sep 14 2009

EXTENSIONS

Keyword:base added, sequence extended by R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Oct 16 2009

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 7 08:40 EST 2009. Contains 170430 sequences.


AT&T Labs Research