|
| |
|
|
A038219
|
|
A maximally unpredictable sequence.
|
|
8
| |
|
|
0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1
|
|
|
COMMENTS
| Comment from Chris Heckman (checkman(AT)mathi17.la.asu.edu), Feb 10 2005: The sequence starts 0,1,0 and continues according to the following rule: find the longest sequence at the end that has occurred at least once previously. If there are more than one previous occurrences select the last one. The next digit of the sequence is the opposite of the one following the previous occurrence.
|
|
|
REFERENCES
| A. Ehrenfeucht and J. Mycielski, A pseudorandom sequence - how random is it?, Amer. Math. Monthly, 99 (1992), 373-375.
|
|
|
LINKS
| Reinhard Zumkeller, Table of n, a(n) for n = 1..5000
K. Sutner, The Ehrenfeucht-Mycielski sequence
Author?, Title?
|
|
|
PROG
| (Haskell)
a038219 n = a038219_list !! n
a038219_list = 0 : f [0] where
f us = a' : f (us ++ [a']) where
a' = b $ reverse $ map (`splitAt` us) [0..length us - 1] where
b ((xs, ys):xyss) | vs `isSuffixOf` xs = 1 - head ys
| otherwise = b xyss
vs = fromJust $ find (`isInfixOf` init us) $ tails us
-- Reinhard Zumkeller, Dec 05 2011
|
|
|
CROSSREFS
| Cf. A007061 (1, 2 version).
Cf. A201881 (run lengths).
Sequence in context: A188014 A189572 A197819 * A172486 A189668 A189661
Adjacent sequences: A038216 A038217 A038218 * A038220 A038221 A038222
|
|
|
KEYWORD
| nonn,nice
|
|
|
AUTHOR
| N. J. A. Sloane (njas(AT)research.att.com), Mira Bernstein (mira(AT)math.berkeley.edu)
|
|
|
EXTENSIONS
| More terms from Joshua Zucker (joshua.zucker(AT)stanfordalumni.org), Aug 11 2006
Offset changed by Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 11 2011
|
| |
|
|