login
A263833
Sprague-Grundy sequence G(i-Mark({1,2}, {2})).
1
0, 1, 2, 0, 1, 2, 3, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 3, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 2
OFFSET
0,3
LINKS
Eric Sopena, i-Mark: A new subtraction division game, arXiv:1509.04199 [cs.DM], 2015.
MAPLE
A263833 := proc(n)
local strt, q, r, R, Rtz, R1 ;
strt := [0, 1, 2, 0, 1, 2, 3, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2] ;
if n <= 17 then
return op(n+1, strt) ;
else
# Theorem 7
q := floor(n/3) ;
r := modp(n, 3) ;
if r = 1 then
return 0 ;
elif r =2 then
return 1;
else
# Theorem 8, after correction by E. Sopena
if type (q, 'even') then
Rtz := A007814(q) ;
R1 := q/2^Rtz ;
if (R1 = 1 or R1 =5) and type(Rtz, 'even') then
return 3 ;
elif R1 <> 1 and R1 <> 5 and type(Rtz, 'odd') then
return 3 ;
else
return 2;
end if;
else
return 2;
end if;
end if;
end if;
end proc: # R. J. Mathar, Nov 03 2015
MATHEMATICA
A263833[n_] := Module[{strt, q, r, R, Rtz, R1}, strt = {0, 1, 2, 0, 1, 2, 3, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2}; If[n <= 17, Return[strt[[n+1]]], q = Floor[n/3]; r = Mod[n, 3]; Which[r == 1, Return[0], r == 2, Return[1], True, If[EvenQ[q], Rtz = IntegerExponent[q, 2]; R1 = q/2^Rtz; Which[R1 == 1 || R1 == 5 && EvenQ[Rtz], Return[3], R1 != 1 && R1 != 5 && OddQ[Rtz], Return[3], True, Return[2]], Return[2]]]]];
Table[A263833[n], {n, 0, 120}] (* Jean-François Alcover, Mar 27 2018, after R. J. Mathar *)
CROSSREFS
Sequence in context: A323844 A350263 A360677 * A308625 A221469 A350369
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 29 2015
STATUS
approved