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.

A335135 Number of composite numbers between prime(n)^2 and prime(n + 1)^2 - 1.

This page as a plain text file.
%I A335135 #30 Feb 16 2025 08:44:37
%S A335135 3,11,18,57,39,98,61,141,265,104,351,268,148,314,520,594,208,678,486,
%T A335135 258,806,573,918,1325,703,366,753,390,788,3006,933,1443,503,2581,542,
%U A335135 1666,1734,1192,1842,1917,644,3364,691,1416,717,4457,4729
%N A335135 Number of composite numbers between prime(n)^2 and prime(n + 1)^2 - 1.
%H A335135 Amiram Eldar, <a href="/A335135/b335135.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..2000 from Robert Israel)
%F A335135 a(n) = prime(n + 1)^2 - prime(n)^2 - (pi(prime(n + 1)^2) - pi(prime(n)^2)).
%F A335135 a(n) = A053683(n+1) - A053683(n). - _Michel Marcus_, Aug 27 2022
%e A335135 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.
%p A335135 f:= proc(n) local p,q;
%p A335135 p:= ithprime(n); q:= nextprime(p);
%p A335135 q^2 - p^2 - numtheory:-pi(q^2)+numtheory:-pi(p^2)
%p A335135 end proc:
%p A335135 map(f, [$1..50]); # _Robert Israel_, Jun 24 2020
%t A335135 Array[#1 - #2 - (PrimePi@ #1 - PrimePi@ #2) & @@ {Prime[# + 1]^2, Prime[#]^2} &, 47] (* _Michael De Vlieger_, May 24 2020 *)
%o A335135 (PARI) forprime(n = 2, 220, s = 0; forcomposite(k = n^2, nextprime(n + 1)^2 - 1, s++); print1(s", "))
%Y A335135 Cf. A000040, A002808, A053683.
%K A335135 nonn,look
%O A335135 1,1
%A A335135 _Dimitris Valianatos_, May 24 2020