login
A256917
Primes which are not the sums of two consecutive nonsquares.
1
2, 3, 7, 17, 19, 31, 71, 73, 97, 127, 163, 199, 241, 337, 449, 577, 647, 881, 883, 967, 1151, 1153, 1249, 1459, 1567, 1801, 2179, 2311, 2591, 2593, 2887, 3041, 3361, 3527, 3529, 3697, 4049, 4051, 4231, 4801, 4999, 5407, 6271, 6961, 7687, 7937, 8191, 8713, 9521, 10369, 10657
OFFSET
1,1
COMMENTS
The union of 2 and A066436 and A090698.
The sums of two consecutive nonsquares are 5, 8, 11, 13, 15, 18, 21, 23, 25, 27, 29, 32, 35, 37, ...
LINKS
Colin Barker and Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 800 terms from Barker)
EXAMPLE
2, 3, 7 are in this sequence because first three sums of two consecutive nonsquares are 5, 8, 11 and 2, 3, 7 are primes.
MATHEMATICA
Union[{2}, Select[Table[2n^2-1, {n, 0, 1000}], PrimeQ], Select[Table[2n^2+1, {n, 0, 1000}], PrimeQ]] (* Ivan N. Ianakiev, Apr 24 2015 *)
Module[{nn=11000, ns}, ns=Total/@Partition[Select[Range[nn], !IntegerQ[Sqrt[#]]&], 2, 1]; Complement[ Prime[Range[PrimePi[Last[ns]]]], ns]] (* Harvey P. Dale, Mar 06 2024 *)
PROG
(PARI)
a256917(maxp) = {
ps=[2];
k=1; while((t=2*k^2-1)<=maxp, k++; if(isprime(t), ps=setunion(ps, [t])));
k=1; while((t=2*k^2+1)<=maxp, k++; if(isprime(t), ps=setunion(ps, [t])));
ps
}
a256917(11000) \\ Colin Barker, Apr 23 2015
(PARI) list(lim)=my(v=List([2]), t); for(k=2, sqrtint((lim+1)\2), if(isprime(t=2*k^2-1), listput(v, t))); for(k=1, sqrtint((lim-1)\2), if(isprime(t=2*k^2+1), listput(v, t))); Set(v) \\ Charles R Greathouse IV, Apr 23 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved