Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A157238
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A157238 0-1 sequence generated by starting with a 0, and then by using whichever of 0, 1 will result in the shortest sequence repeated at the end. +0
1
0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0 (list; graph; listen)
OFFSET

1,1

EXAMPLE

a(6)=1 as 0,1,0,0,1,1 has a longest repeated sequence of length 1 at the end, whereas 0,1,0,0,1,0 has a longest repeated sequence of length 3 at the end. Similarly a(7)=0 since 0,1,0,0,1,1,0 has a longest repeated sequence of length 0 at the end.

PROGRAM

(Python)

.x = [0]

.while (len(x) < 1000):

..t = x[ -1]

..z = 1

..while (2*z+1 <= len(x)):

...if (x[ -z:] == x[ -(2*z+1):-(z+1)]):

....t = x[ -(z+1)]

...z += 1

..x += [1-t]

CROSSREFS

Sequence in context: A084091 A080846 A082401 this_sequence A059448 A156259 A038219

Adjacent sequences: A157235 A157236 A157237 this_sequence A157239 A157240 A157241

KEYWORD

nonn

AUTHOR

Luke Pebody (luke.pebody(AT)gmail.com), Feb 25 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 21 10:15 EST 2009. Contains 171081 sequences.


AT&T Labs Research