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

A383259 a(n) is the excess of even composites over odd composites in the first n positive integers.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 3, 2, 3, 3, 4, 4, 5, 4, 5, 5, 6, 6, 7, 6, 7, 7, 8, 7, 8, 7, 8, 8, 9, 9, 10, 9, 10, 9, 10, 10, 11, 10, 11, 11, 12, 12, 13, 12, 13, 13, 14, 13, 14, 13, 14, 14, 15, 14, 15, 14, 15, 15, 16, 16, 17, 16, 17, 16, 17, 17, 18, 17, 18, 18, 19, 19, 20
Offset: 1

Views

Author

Felix Huber, Apr 24 2025

Keywords

Examples

			Of the first 9 positive integers are three (4, 6, 8) even and one (9) is odd, so a(9) = 3 - 1 = 2.
		

Crossrefs

Programs

  • Maple
    A383259:=n->`if`(n=1,0,NumberTheory:-pi(n)-(n mod 2)-1);seq(A383259(n),n=1..74);
  • Mathematica
    a[1]:=0; a[n_]:=PrimePi[n]- Mod[n,2] - 1; Array[a,74] (* Stefano Spezia, Apr 25 2025 *)

Formula

a(n) = pi(n) - (n mod 2) - 1 = A000720(n) - A000034(n) for n > 1.
abs(a(n)-a(n-1)) = A066247(n).

A381251 a(n) is the number of ways to write prime(n) as a sum of distinct composites.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 3, 4, 10, 14, 27, 40, 52, 74, 133, 229, 276, 457, 626, 744, 1189, 1599, 2498, 4450, 5862, 6752, 8835, 10139, 13189, 32481, 41614, 60099, 67900, 122825, 138101, 195147, 274193, 342783, 477381, 661502, 736865, 1252245, 1390615, 1711496, 1897886
Offset: 1

Views

Author

Felix Huber, Apr 19 2025

Keywords

Comments

Subsequence of A204389.
All sums have an odd number of odd composite summands (A071904).

Examples

			a(8) = 3 because prime(8) = 19 can be written in 3 ways as a sum of distinct composites: 19 = 9 + 10 = 9 + 4 + 6 = 15 + 4.
		

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..100)]:
    C:= {$2..P[-1]} minus convert(P,set):
    G:= mul(1+x^c,c=C):
    seq(coeff(G,x,P[i]),i=1..100); # Robert Israel, Apr 22 2025

Formula

a(n) = A204389(A000040(n)). - R. J. Mathar, Apr 22 2025
Showing 1-2 of 2 results.