login
From P-positions in a certain game.
2

%I #9 Apr 13 2019 14:17:22

%S 0,1,3,7,12,13,21,30,31,42,45,60,61,78,79,98,99,121,144,145,170,171,

%T 198,199,228,231,264,265,300,301,338,339,378,379,420,422,423,469,516,

%U 517,566,567,618,619,672,673,728,729,786,787,846,849,912,913,978,979,1046,1047,1116,1117,1188,1189,1262,1263,1338

%N From P-positions in a certain game.

%H A. S. Fraenkel, <a href="http://www.emis.de/journals/INTEGERS/papers/eg6/eg6.Abstract.html">New games related to old and new sequences</a>, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 4, Paper G6, 2004.

%F Let a(n) = A081694(n) and let b(n) = n-th term of the current sequence. Then a(n) = mex{ a(i), b(i) : 0 <= i < n}; b(n) = a(n) + b(n-1) - (1+(-1)^b(n-1))*a(n-1)/2. Also, apart from initial zero, current sequence is complement of A081694.

%p A081694 := proc(n)

%p option remember;

%p local i;

%p if n <=1 then

%p n;

%p else

%p { seq(procname(i),i=0..n-1)} union {seq(A081695(i),i=0..n-1)} ;

%p mex(%) ;

%p end if;

%p end proc:

%p A081695 := proc(n)

%p option remember;

%p if n <= 1 then

%p n;

%p else

%p A081694(n)+procname(n-1)-(1+(-1)^procname(n-1))*A081694(n-1)/2 ;

%p end if;

%p end proc:

%p seq(A081695(n),n=0..70) ; # _R. J. Mathar_, Apr 13 2019

%Y Cf. A081694.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_, Apr 02 2003

%E More terms from _R. J. Mathar_, Apr 13 2019