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.

A213784 Numbers k such that both k and k^2 are sums of a twin prime pair.

Original entry on oeis.org

12, 84, 204, 456, 1140, 5424, 10044, 11004, 13656, 17940, 27804, 36576, 43296, 62784, 72024, 87576, 87780, 94116, 99336, 107184, 120204, 131460, 161496, 165516, 168636, 179640, 187116, 190464, 197820, 213324, 219696, 235080, 235620, 244404, 251796, 263556
Offset: 1

Views

Author

Zak Seidov, Jun 19 2012

Keywords

Comments

Or, k such that k/2 +- 1 and (k^2)/2 +- 1 are primes. Hence all k's are multiples of 12.

Examples

			12 = 5 + 7, 12^2 = 144 = 71 + 73.
		

Crossrefs

Subsequence of A213739.

Programs

  • Mathematica
    Reap[ Do[ If[ And @@ PrimeQ /@ {n/2-1, n/2+1, n^2/2-1, n^2/2+1}, Sow[n]], {n, 12, 263556, 12}]][[2, 1]] (* Jean-François Alcover, Jul 17 2012 *)
    tppQ[n_]:=And@@PrimeQ[n/2+{1,-1}]&&And@@PrimeQ[n^2/2+{1,-1}]; Select[ Range[ 12,300000,12],tppQ] (* Harvey P. Dale, Dec 20 2012 *)
    Select[12*Range[22000],AllTrue[Flatten[{#/2+{1,-1},#^2/2+{1,-1}}],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 07 2015 *)
  • PARI
    is(n)=if(n%12, return(0)); isprime(n/2-1) && isprime(n/2+1) && isprime(n^2/2-1) && isprime(n^2/2+1) \\ Charles R Greathouse IV, Jul 31 2016