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-4 of 4 results.

A131807 Partial sums of A131377.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 8, 8, 8, 9, 10, 11, 12, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 22, 22, 23, 24, 25, 26, 26, 26, 26, 26, 26, 26, 27, 28, 29, 30, 31, 32, 32, 32, 33, 34, 35, 36, 37, 38, 38, 38, 38, 38, 39, 40, 40
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A131377.

Programs

  • Maple
    P:=proc(n) local i,k,s; k:=1; s:=0; for i from 0 by 1 to n do if isprime(i) then if k=1 then k:=0; else k:=1; fi; fi; s:=s+k; print(s); od; end: P(100);
  • PARI
    a(n) = sum(m=0, n, (primepi(m) % 2) == 0) \\ Michel Marcus, Aug 15 2023

A131378 Starting with 0, the sequence a(n) changes from 0 to 1 or back when the next number n is a prime.

Original entry on oeis.org

0, 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
Offset: 0

Views

Author

Keywords

Comments

Zero together with A071986. - Omar E. Pol, Feb 19 2011
Parity of A230980. - Omar E. Pol, Jul 19 2019

Examples

			n = 0, 1, 2, 3, 4, 5, etc.
a(n)= 0, 0, 1, 0, 0, 1, etc.
Starting with 0 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.
		

Crossrefs

Cf. A131377.
Cf. A071986. - Omar E. Pol, Feb 19 2011

Programs

  • Maple
    P:=proc(n) local i,k; k:=0; 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);
  • Mathematica
    nxt[{n_,a_}]:={n+1,Which[a==0&&PrimeQ[n+1],1,a==1&&PrimeQ[n+1],0,True,a]}; NestList[nxt,{0,0},100][[All,2]] (* Harvey P. Dale, Jul 19 2019 *)

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

A385628 Sum of the divisors d of n with an even number of primes not exceeding d.

Original entry on oeis.org

1, 1, 4, 5, 1, 4, 8, 13, 13, 11, 1, 8, 14, 22, 19, 29, 1, 13, 20, 35, 32, 23, 1, 16, 1, 14, 13, 26, 30, 59, 1, 29, 4, 1, 8, 17, 38, 58, 56, 83, 1, 46, 44, 71, 73, 47, 1, 32, 8, 11, 4, 18, 54, 67, 56, 90, 80, 88, 1, 83, 62, 63, 104, 93, 79, 92, 1, 5, 4, 32, 72, 97, 1, 38, 19, 62, 8, 56, 80, 179, 94, 83, 1, 50, 1, 44, 33, 79, 90, 203, 112, 143, 97, 95, 115
Offset: 1

Views

Author

Wesley Ivan Hurt, Jul 05 2025

Keywords

Comments

Inverse Möbius transform of n * ((pi(n)+1) mod 2) = n * A131377(n).

Examples

			The sum of the divisors d of 16 such that pi(d) is even gives 1 + 4 + 8 + 16 = 29.
		

Crossrefs

Cf. A000203 (sigma), A000720 (pi), A131377, A345220, A385625.

Programs

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

Formula

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