A383037 a(n) is the excess of composites over primes in the first n odd positive integers.
0, -1, -2, -3, -2, -3, -4, -3, -4, -5, -4, -5, -4, -3, -4, -5, -4, -3, -4, -3, -4, -5, -4, -5, -4, -3, -4, -3, -2, -3, -4, -3, -2, -3, -2, -3, -4, -3, -2, -3, -2, -3, -2, -1, -2, -1, 0, 1, 0, 1, 0, -1, 0, -1, -2, -1, -2, -1, 0, 1, 2, 3, 4, 3, 4, 3, 4, 5, 4, 3, 4
Offset: 1
Examples
Of the first 5 odd positive integers (1, 3, 5, 7, 9), one (9) is a composite and three (3, 5, 7) are primes, so a(5) = 1 - 3 = -2.
Links
- Felix Huber, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Odd Number
Programs
-
Maple
A383037:=n->n-NumberTheory:-pi(2*n)*2+1;seq(A383037(n),n=1..71);
-
Mathematica
a[n_]:=n - 2*PrimePi[2*n] + 1; Array[a,71] (* Stefano Spezia, Apr 20 2025 *)
Comments