cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A046695 Sprague-Grundy values for the game Couples-are-Forever (and for octal games .6, .601, .61, .611, .62, .621, .63, .631).

This page as a plain text file.
%I A046695 #19 Mar 07 2020 21:21:48
%S A046695 0,0,1,2,0,1,2,3,1,2,3,4,0,3,4,2,1,3,2,1,0,2,1,4,5,1,4,5,1,2,0,1,2,3,
%T A046695 1,2,3,4,2,3,4,2,3,4,2,1,0,2,8,4,5,3,4,5,6,2,5,1,2,3,1,2,3,4,2,3,4,2,
%U A046695 3,4,2,3,0,2,3,4,5,3,4,5,6,4,5,6,2,3,1,2,3,4,2,3,4,2,3,4,2,3,0,2,3,4
%N A046695 Sprague-Grundy values for the game Couples-are-Forever (and for octal games .6, .601, .61, .611, .62, .621, .63, .631).
%H A046695 Allan C. Wechsler, <a href="/A046695/b046695.txt">Table of n, a(n) for n = 0..1000</a>
%H A046695 I. Caines et al., <a href="http://www.jstor.org/stable/2589561">Periods in taking and splitting games</a>, Amer. Math. Monthly, 106 (1999), 359-361.
%F A046695 a(n) = A071433(n-1). - Typo corrected by _Allan C. Wechsler_, Oct 24 2014
%o A046695 (Haskell)
%o A046695 nimSum 0 0 = 0
%o A046695 nimSum a 0 = a
%o A046695 nimSum 0 b = b
%o A046695 nimSum a b = 2*(nimSum (div a 2) (div b 2)) + (rem ((rem a 2) + (rem b 2)) 2)
%o A046695 mexp l = head (filter (\x -> (not (elem x l))) [0..])
%o A046695 a046695_list = map a046695 [0..]
%o A046695 a046695 0 = 0
%o A046695 a046695 1 = 0
%o A046695 a046695 n = mexp (a046695' n)
%o A046695 a046695' n = (map trymove [0..(div (n-1) 2)])
%o A046695   where trymove k = nimSum (a046695_list !! k) (a046695_list !! (n-k-1))
%o A046695 -- _Allan C. Wechsler_, Nov 18 2014
%Y A046695 Cf. A071433.
%K A046695 nonn
%O A046695 0,4
%A A046695 _N. J. A. Sloane_
%E A046695 Edited and extended by _Christian G. Bower_, Oct 22 2002