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 A131377 #17 Jul 05 2025 10:44:46 %S A131377 1,1,0,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0, %T A131377 0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0, %U A131377 0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0 %N A131377 a(n) = (pi(n)+1) mod 2. %C A131377 Old name was: Starting with 1, the sequence a(n) changes from 1 to 0 or back when the next number n is a prime. %C A131377 Möbius transform of A345220(n). - _Wesley Ivan Hurt_, Jul 05 2025 %F A131377 a(n) = 1 - A071986(n). %F A131377 From _Wesley Ivan Hurt_, Jul 05 2025: (Start) %F A131377 a(n) = A000035(A036234(n)). %F A131377 a(n) = Sum_{d|n} A345220(d) * mu(n/d). (End) %e A131377 n = 0, 1, 2, 3, 4, 5, etc.. %e A131377 a(n)= 1, 1, 0, 1, 1, 0, etc. %e A131377 Starting with 1 the sequence changes when we move from 1 to 2 because 2 is prime, again from 2 to 3 because also 3 is prime, then from 4 to 5 being 5 prime and so on. %p A131377 P:=proc(n) local i,k; k:=1; for i from 0 by 1 to n do if isprime(i) then if k=1 then k:=0; else k:=1; fi; fi; print(k); od; end: P(100); %t A131377 Table[Mod[PrimePi[n] + 1, 2], {n, 0, 100}] (* _Wesley Ivan Hurt_, Jul 05 2025 *) %Y A131377 Cf. A000035 (n mod 2), A000720 (pi), A008683 (mu), A036234, A131378, A345220. %Y A131377 Cf. A071986. - _Omar E. Pol_, Feb 19 2011 %K A131377 easy,nonn %O A131377 0,1 %A A131377 _Paolo P. Lava_ and _Giorgio Balzarotti_, Jul 04 2007 %E A131377 New name from _Wesley Ivan Hurt_, Jul 05 2025