%I #27 Dec 26 2022 11:39:27
%S 0,1,0,0,1,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,1,1,
%T 1,0,0,1,0,1,1,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,1,0,1,0,1,1,
%U 0,1,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,0,0,1,0,1,0,0,1,1,0,1,1,0
%N Parity of A061418.
%C Can be described as follows: starting from a single pair of animals, and assuming any pair of animals can produce one offspring per day (as in the game Minecraft), a(n) = 0 on days with an even number of animals and 1 on days with an odd number.
%C While this sequence is easily generated from A061418, the reverse is also true. If we let r = sum of a(n)(2/3)^n = 0.755459... then the n-th term of A061418 is given by ceiling((4-r)/3*(3/2)^n).
%C The sequence is related to K(3) from the Josephus problem (A083286) via sum r = 4 - 2*K(3).
%H E. T. H. Wang and Phillip C. Washburn, <a href="http://www.jstor.org/stable/2322068">Problem E2604</a>, American Mathematical Monthly, 84 (1977), 821-822.
%F a(n) = A061418(n) mod 2.
%p b:= proc(n) option remember; iquo(3*b(n-1), 2) end: b(1):= 2:
%p a:= n-> irem(b(n), 2):
%p seq(a(n), n=1..200); # _Alois P. Heinz_, Sep 20 2022
%t A061418[n_] := A061418[n] = If[n==1, 2, Quotient[3*A061418[n-1], 2]];
%t a[n_] := Mod[A061418[n], 2];
%t Table[a[n], {n, 1, 200}] (* _Jean-François Alcover_, Dec 26 2022 *)
%o (Python)
%o def a(n):
%o val = 2
%o for i in range(n):
%o val += val//2
%o return val%2
%Y Cf. A061418.
%K easy,nonn
%O 1
%A _Jacob Fauman_, Aug 12 2022
|