%I #17 Sep 08 2022 08:45:54
%S 1,0,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
%T 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
%U 0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
%N a(1)=1. After that, a(n) = a(n-1) XOR a(floor(sqrt(n))).
%H Antti Karttunen, <a href="/A181359/b181359.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F a(1) = 1; for n > 1, a(n) = A000035(a(n-1) + a(A000196(n))). - _Antti Karttunen_, Dec 16 2017, after Magma program of _Klaus Brockhaus_
%t f[1] := True
%t f[x_] := Xor[f[x - 1], f[Floor[Sqrt[x]]]]
%o (Magma) [ n eq 1 select 1 else (Self(n-1)+Self(Isqrt(n))) mod 2: n in [1..105] ]; // _Klaus Brockhaus_, Oct 16 2010
%o (PARI) first(n) = my(res = vector(n)); res[1]=1; for(x=2, n, res[x]=bitxor(res[x-1], res[floor(sqrt(x))])); res \\ _Iain Fox_, Dec 16 2017
%o (Scheme, with memoization-macro definec) (definec (A181359 n) (if (= 1 n) n (A000035 (+ (A181359 (- n 1)) (A181359 (A000196 n)))))) ;; _Antti Karttunen_, Dec 16 2017
%Y Cf. A000196 (integer part of square root of n). - _Klaus Brockhaus_, Oct 16 2010
%K nonn
%O 1,1
%A _Ben Branman_, Oct 14 2010