

A235986


Numbers n such that two of the primes between n^2 and (n+1)^2 add up to n^2+(n+1)^2  1.


0



2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Up to 10^6, the numbers missing from the sequence are 1, 17, 19, 46, 58, 64, 67, 85, and 367.  Giovanni Resta, Feb 26 2014


LINKS

Table of n, a(n) for n=1..55.


EXAMPLE

For n=2 n+1=3; primes between 4 and 9 are (5,7);4+91=12 and 5+7=12.
For n=3 n+1=4; primes between 9 and 16 are (11,13); 9+161=24 and 11+13=24.
For n=18 n+1=19; primes between 324 and 361 are (331,337,347,349,353,359);324+3611=684 and 331+353=684.


MATHEMATICA

ok[n_] := n>1 && Catch@Block[{p = NextPrime[n^2]}, While[p < (n+1)^2, If[PrimeQ[ 2*n*(n+1)  p], Throw@True, p = NextPrime@p]]; False]; Select[Range@100, ok] (* Giovanni Resta, Feb 26 2014 *)


PROG

(PARI) buildp(n) = {vp = []; forprime(p = n^2, (n+1)^2, vp = concat(vp, p); ); vp; }
issum(vp, n) = {summ = n^2+(n+1)^2  1; for (i = 1, #vp, for (j = i+1, #vp, if (vp[i]+vp[j] == summ, return (1)); ); ); return (0); }
isok(n) = vp = buildp(n); issum(vp, n); \\ Michel Marcus, Jan 18 2014


CROSSREFS

Sequence in context: A023810 A102800 A072676 * A080197 A115847 A204315
Adjacent sequences: A235983 A235984 A235985 * A235987 A235988 A235989


KEYWORD

nonn


AUTHOR

César Aguilera, Jan 17 2014


STATUS

approved



