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

A073946 Squares k such that k + pi(k) is a prime.

Original entry on oeis.org

9, 36, 81, 121, 361, 625, 961, 3136, 6724, 8281, 9604, 10609, 12996, 13225, 19881, 25281, 38025, 39204, 40000, 43264, 44944, 45796, 47961, 60516, 64009, 79524, 80089, 80656, 83521, 86436, 90000, 93636, 103684, 117649, 121801, 129600
Offset: 1

Views

Author

David Garber, Nov 13 2002

Keywords

Examples

			a(1)=9, since 9 is a square, pi(9)=4 and 9+4=13 is a prime.
		

Crossrefs

This sequence is a subsequence of sequence A077510. The corresponding sequence of primes is A113943 and the square roots of the original sequence is A113944.

Programs

  • Maple
    select(t -> isprime(t + numtheory:-pi(t)), [seq(i^2,i=1..1000)]); # Robert Israel, Mar 21 2017
  • Mathematica
    Select[Range[1000]^2, PrimeQ[# + PrimePi[#]] &] (* Indranil Ghosh, Mar 21 2017 *)
  • PARI
    v=vector(1000);
    for(n=1, 1000, v[n] = n^2);
    for(n=1, 1000, if(isprime(v[n] + primepi(v[n])), print1(v[n],", "))) \\ Indranil Ghosh, Mar 21 2017
    
  • Python
    from sympy import primepi, isprime
    N = (x**2 for x in range(1, 1001))
    print([n for n in N if isprime(n + primepi(n))]) # Indranil Ghosh, Mar 21 2017
Showing 1-1 of 1 results.