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!)
A245061 Prime numbers p such that p - primepi(p) is a square, where primepi is the prime counting function. 1
2, 3, 37, 541, 647, 881, 1151, 1301, 1627, 2377, 3271, 5179, 5641, 10501, 11597, 11821, 18503, 20543, 23339, 31259, 35461, 38669, 39499, 42901, 43331, 44201, 45523, 51973, 53407, 67213, 67757, 70489, 72169, 77291, 98893, 99551, 128291, 139721, 145207, 150011 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = prime(A064370(n+1)). - Michel Marcus, Jul 11 2014
EXAMPLE
37 is in the sequence because primepi(37) = 12, and 37 - 12 = 5^2.
541 is in the sequence because primepi(541) = 100, and 541 - 100 = 21^2.
547 is not in the sequence because primepi(547) = 101, and 547 - 101 = 446, which is not a perfect square.
MAPLE
with(numtheory): A245061:=n->`if`(type(sqrt(n-pi(n)), integer) and type(n, prime), n, NULL): seq(A245061(n), n=2..10^5); # Wesley Ivan Hurt, Jul 10 2014
MATHEMATICA
Select[Prime[Range[200]], IntegerQ[Sqrt[# - PrimePi[#]]] &] (* Alonso del Arte, Jul 11 2014 *)
PROG
(PARI) select(p->issquare(p-primepi(p)), primes(15000)) \\ Michel Marcus, Jul 11 2014
(Python)
import sympy, gmpy2
[sympy.prime(n) for n in range(1, 10**6) if gmpy2.is_square(sympy.prime(n)-n)] # Chai Wah Wu, Jul 11 2014
CROSSREFS
Sequence in context: A061576 A221055 A144466 * A270587 A119448 A041329
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Jul 10 2014
EXTENSIONS
More terms from Michel Marcus, Jul 11 2014
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 17 19:01 EDT 2024. Contains 372603 sequences. (Running on oeis4.)