The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A335135 Number of composite numbers between prime(n)^2 and prime(n + 1)^2 - 1. 1
3, 11, 18, 57, 39, 98, 61, 141, 265, 104, 351, 268, 148, 314, 520, 594, 208, 678, 486, 258, 806, 573, 918, 1325, 703, 366, 753, 390, 788, 3006, 933, 1443, 503, 2581, 542, 1666, 1734, 1192, 1842, 1917, 644, 3364, 691, 1416, 717, 4457, 4729 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = prime(n + 1)^2 - prime(n)^2 - (pi(prime(n + 1)^2) - pi(prime(n)^2)).
a(n) = A053683(n+1) - A053683(n). - Michel Marcus, Aug 27 2022
EXAMPLE
For n = 1, prime(1) = 2 and prime(2) = 3. So the composite numbers between 2^2 = 4 and 3^2 - 1 = 9 - 1 = 8 are 4, 6, and 8, so a(1) = 3.
MAPLE
f:= proc(n) local p, q;
p:= ithprime(n); q:= nextprime(p);
q^2 - p^2 - numtheory:-pi(q^2)+numtheory:-pi(p^2)
end proc:
map(f, [$1..50]); # Robert Israel, Jun 24 2020
MATHEMATICA
Array[#1 - #2 - (PrimePi@ #1 - PrimePi@ #2) & @@ {Prime[# + 1]^2, Prime[#]^2} &, 47] (* Michael De Vlieger, May 24 2020 *)
PROG
(PARI) forprime(n = 2, 220, s = 0; forcomposite(k = n^2, nextprime(n + 1)^2 - 1, s++); print1(s", "))
CROSSREFS
Sequence in context: A119141 A303520 A225144 * A228470 A246453 A117769
KEYWORD
nonn,look
AUTHOR
Dimitris Valianatos, May 24 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 18:22 EDT 2024. Contains 372522 sequences. (Running on oeis4.)