cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

A071986 Parity of the prime-counting function pi(n).

Original entry on oeis.org

0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1
Offset: 1

Views

Author

Labos Elemer, Jun 17 2002

Keywords

Comments

a(n) + a(n-1) = 1 if and only if n is prime. - Benoit Cloitre, Jun 20 2002
Möbius transform of A345219(n). - Wesley Ivan Hurt, Jul 05 2025

Examples

			a(6)=1 since three primes [2,3,5] are <= 6 and three is odd.
		

Crossrefs

Cf. A000035 (n mod 2), A000720 (pi), A008683 (mu), A345219.

Programs

  • Magma
    [#PrimesUpTo(n) mod 2: n in [1..200]]; // Vincenzo Librandi, Jul 21 2019
  • Mathematica
    Table[Mod[PrimePi[w], 2], {w, 1, 256}]
  • PARI
    a(n)=primepi(n)%2
    
  • PARI
    sq(n)=if (n<6, return(max(n-1,0))); my(s,t); forsquarefree(i=1, sqrtint(n), t=n\i[1]^2; s+=moebius(i)*sum(i=1,sqrtint(t), t\i)); s;
    a(n)=my(s); forsquarefree(i=1,logint(n,2), s+=moebius(i)*sq(sqrtnint(n,i[1]))); s%2 \\ Charles R Greathouse IV, Jan 09 2018
    

Formula

a(n) = pi(n) mod 2.
a(n) = A000035(A000720(n)). - Omar E. Pol, Oct 26 2013
a(n) = Sum_{d|n} A345219(d) * mu(n/d). - Wesley Ivan Hurt, Jul 05 2025

Extensions

Edited by Charles R Greathouse IV, Feb 19 2011

A345220 Number of divisors d of n with an even number of primes not exceeding d.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 2, 3, 3, 2, 1, 3, 2, 3, 3, 4, 1, 3, 2, 4, 4, 2, 1, 4, 1, 2, 3, 4, 2, 5, 1, 4, 2, 1, 2, 4, 2, 3, 4, 6, 1, 5, 2, 4, 5, 2, 1, 5, 2, 2, 2, 3, 2, 4, 2, 6, 4, 3, 1, 7, 2, 2, 6, 5, 3, 4, 1, 2, 2, 4, 2, 6, 1, 2, 3, 4, 2, 4, 2, 8, 4, 2, 1, 6, 1, 2, 3, 5, 2, 8, 4, 4, 3
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 11 2021

Keywords

Comments

Inverse Möbius transform of (pi(n)+1) mod 2 = A131377(n). - Wesley Ivan Hurt, Jul 04 2025

Examples

			a(24) = 4; The divisors d of 24 are: 1, 2, 3, 4, 6, 8, 12, 24 and the corresponding values of pi(d) are: 0, 1, 2, 2, 3, 4, 5, 9. There are 4 even values of pi(d).
		

Crossrefs

Cf. A000005 (tau), A000720 (pi), A131377, A345219.

Programs

  • Mathematica
    Table[Sum[Mod[PrimePi[d] + 1, 2], {d, Divisors[n]}], {n, 100}]
  • PARI
    a(n) = sumdiv(n, d, !(primepi(d) % 2)); \\ Michel Marcus, Jun 11 2021

Formula

a(n) = Sum_{d|n} ((pi(d)+1) mod 2).
a(n) = A000005(n) - A345219(n). - Wesley Ivan Hurt, Jul 05 2025

A385625 Sum of the divisors d of n with an odd number of primes not exceeding d.

Original entry on oeis.org

0, 2, 0, 2, 5, 8, 0, 2, 0, 7, 11, 20, 0, 2, 5, 2, 17, 26, 0, 7, 0, 13, 23, 44, 30, 28, 27, 30, 0, 13, 31, 34, 44, 53, 40, 74, 0, 2, 0, 7, 41, 50, 0, 13, 5, 25, 47, 92, 49, 82, 68, 80, 0, 53, 16, 30, 0, 2, 59, 85, 0, 33, 0, 34, 5, 52, 67, 121, 92, 112, 0, 98, 73, 76, 105, 78, 88, 112, 0, 7, 27, 43, 83, 174, 107, 88, 87, 101, 0, 31, 0, 25, 31, 49, 5, 124, 97, 149
Offset: 1

Views

Author

Wesley Ivan Hurt, Jul 05 2025

Keywords

Comments

Inverse Möbius transform of n * (pi(n) mod 2) = n * A071986(n).

Examples

			The sum of the divisors d of 12 such that pi(d) is odd gives 2 + 6 + 12 = 20.
		

Crossrefs

Cf. A000203 (sigma), A000720 (pi), A071986, A345219, A385628.

Programs

  • Mathematica
    Table[Sum[d*Mod[PrimePi[d], 2], {d, Divisors[n]}], {n, 100}]

Formula

a(n) = Sum_{d|n} d * (pi(d) mod 2).
a(n) = A000203(n) - A385628(n).
Showing 1-3 of 3 results.