The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
EXAMPLE
For n=2 n+1=3; primes between 4 and 9 are (5,7);4+9-1=12 and 5+7=12.
For n=3 n+1=4; primes between 9 and 16 are (11,13); 9+16-1=24 and 11+13=24.
For n=18 n+1=19; primes between 324 and 361 are (331,337,347,349,353,359);324+361-1=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 A341749 A115847
KEYWORD
nonn
AUTHOR
César Aguilera, Jan 17 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 20:35 EDT 2024. Contains 372555 sequences. (Running on oeis4.)