login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(4n) = 0, a(2n+1) = 1, a(4n+2) = a(n+1).
5

%I #11 Apr 04 2024 10:04:39

%S 0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,

%T 1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,

%U 0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1

%N a(4n) = 0, a(2n+1) = 1, a(4n+2) = a(n+1).

%C Apparently, the first differences of A072894.

%H Antti Karttunen, <a href="/A098725/b098725.txt">Table of n, a(n) for n = 0..65537</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%t A098725[n_] := Which[OddQ[n], 1, Divisible[n, 4], 0, True, A098725[(n+2)/4]];

%t Array[A098725, 100, 0] (* _Paolo Xausa_, Apr 04 2024 *)

%o (PARI) a(n)=if(n%2==1,1,if(n%4==0,0,a((n-2)/4+1)))

%K nonn

%O 0,1

%A _Ralf Stephan_, Oct 15 2004