This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A152822 #50 Dec 12 2023 08:14:08 %S A152822 1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1, %T A152822 0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1, %U A152822 1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1 %N A152822 Periodic sequence [1,1,0,1] of length 4. %H A152822 Antti Karttunen, <a href="/A152822/b152822.txt">Table of n, a(n) for n = 0..65537</a> %H A152822 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>. %H A152822 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1). %F A152822 a(n) = 3/4 - (1/4)*(-1)^n + (1/2)*cos(n*Pi/2); %F A152822 a(n+4) = a(n) with a(0) = a(1) = a(3) = 1 and a(2) = 0; %F A152822 O.g.f.: (1+z+z^3)/(1-z^4); %F A152822 a(n) = ceiling(cos(Pi*n/4)^2). - _Wesley Ivan Hurt_, Jun 12 2013 %F A152822 From _Antti Karttunen_, May 03 2022: (Start) %F A152822 Multiplicative with a(p^e) = 1 for odd primes, and a(2^e) = [e > 1]. (Here [ ] is the Iverson bracket, i.e., a(2^e) = 0 if e=1, and 1 if e>1). %F A152822 a(n) = A166486(2+n). %F A152822 (End) %F A152822 Dirichlet g.f.: zeta(s)*(1 - 1/2^s + 1/4^s). - _Amiram Eldar_, Dec 27 2022 %p A152822 a:= n-> [1,1,0,1][1+irem(n,4)]: %p A152822 seq(a(n), n=0..104); # _Alois P. Heinz_, Sep 01 2021 %o A152822 (PARI) a(n)=n%4!=2 \\ _Jaume Oliver Lafont_, Mar 24 2009 %o A152822 (PARI) A152822(n) = { my(f=factor(n)); prod(k=1,#f~,if(2==f[k,1],f[k,2]>1,1)); }; \\ (After multiplicative formula) - _Antti Karttunen_, May 03 2022 %o A152822 (Python) %o A152822 def A152822(n): return (1,1,0,1)[n&3] # _Chai Wah Wu_, Jan 10 2023 %Y A152822 Characteristic function of A042965. %Y A152822 Cf. A026052, A026064, A320111 (inverse Möbius transform). %Y A152822 Sequence A166486 shifted by two terms. %K A152822 easy,nonn,mult %O A152822 0,1 %A A152822 _Richard Choulet_, Dec 13 2008 %E A152822 More terms from _Philippe Deléham_, Dec 21 2008 %E A152822 Keyword:mult added by _Andrew Howroyd_, Jul 27 2018