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!)
A067018 Start with a(0)=1, a(1)=4, a(2)=3, a(3)=2; for n>=3, a(n+1) = mex_i (nim-sum a(i)+a(n-i)), where mex means smallest nonnegative missing number. 3
1, 4, 3, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Nim-sum is addition in base 2 without carry (XOR the binary expansions).
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, E27.
LINKS
EXAMPLE
a(5) = mex{1 xor 0, 4 xor 2, 3 xor 3, etc. (duplicates)} = mex{1 xor 0, 100 xor 10, 11 xor 11} (in base 2) = mex{1, 6, 0} = 2
PROG
(Haskell)
import Data.Bits (xor)
import Data.List ((\\))
a067018 n = a067018_list !! n
a067018_list = [1, 4, 3, 2] ++ f [2, 3, 4, 1] where
f xs = mexi : f (mexi : xs) where
mexi = head $ [0..] \\ zipWith xor xs (reverse xs) :: Integer
-- Reinhard Zumkeller, May 05 2012
CROSSREFS
Sequence in context: A349989 A067017 A258692 * A200233 A350493 A327351
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Feb 17 2002
EXTENSIONS
More terms from John W. Layman, Feb 20 2002
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 April 19 15:34 EDT 2024. Contains 371794 sequences. (Running on oeis4.)