OFFSET
1,1
COMMENTS
This is a subset of A002327 and A002383 taken together. Note that 3 is not a member, as the pairing (3, 5) is excluded as defined, as 3 and 5 associate to different centers.
The corresponding n are in A088485.
The average of each twin prime pair is an oblong number (A002378). - Michel Marcus, Feb 04 2017
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..3594 from G. C. Greubel)
FORMULA
a(2n-1) = A088486(n). a(2n)=2+a(2n-1).
EXAMPLE
For k = 6, k^2 + k = 6^2 + 6 = 42, and (41,43) is a twin prime pair, so 41 and 43 are in the sequence.
MATHEMATICA
{#^2 + # - 1, #^2 + # + 1} & /@ Select[Range@ 200, PrimeQ[#^2 + # - 1] && PrimeQ[#^2 + # + 1] &] // Flatten (* Michael De Vlieger, Nov 30 2015 *)
Flatten[Select[Table[n^2 + n + {-1, 1}, {n, 0, 200}], And@@PrimeQ[#] &]] (* Vincenzo Librandi, Feb 05 2017 *)
PROG
(PARI) genit()={my(maxx=1000); n=0; while(n<maxx, n+=1; q=n^2+n; if( isprime(q-1)&&isprime(q+1), print1(q-1, ", ", q+1, ", "))); }
(Magma) &cat[[n^2+n-1, n^2+n+1]: n in [0..250]| IsPrime(n^2+n-1) and IsPrime(n^2+n+1)]; // Vincenzo Librandi, Feb 05 2017
CROSSREFS
KEYWORD
nonn,easy,tabf
AUTHOR
Bill McEachen, Nov 29 2015
STATUS
approved