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.

A123993 Primes p such that p^2 is an interprime = average of two successive primes.

Original entry on oeis.org

2, 3, 41, 907, 1151, 1553, 1609, 1667, 1801, 1907, 1933, 2351, 2473, 2531, 2953, 3001, 3571, 4007, 4073, 4253, 4663, 5023, 5417, 5881, 6143, 6257, 6329, 6343, 7879, 8461, 8521, 8563, 9041, 9067, 10103, 10781, 11243, 11251, 11257, 12097, 12413, 13217
Offset: 1

Views

Author

Alexander Adamchuk, Oct 30 2006

Keywords

Comments

Primes in A075190 (numbers n such that n^2 is an interprime).

Crossrefs

Cf. A075190, A024675 (interprimes).

Programs

  • Mathematica
    Select[PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Select[ Range[25000], 2#^2 == PrevPrim[ #^2] + NextPrim[ #^2] &],PrimeQ]
    atsp[n_]:=Module[{n2=n^2},(NextPrime[n2]+NextPrime[n2,-1])/2==n2]; Select[Prime[Range[2000]],atsp]  (* Harvey P. Dale, Jan 05 2011 *)
  • PARI
    isok(p) = isprime(p) && ((nextprime(p^2) + precprime(p^2)) / 2 - p^2 == 0); \\ Michel Marcus, Dec 11 2020