OFFSET
1,2
COMMENTS
The sequence is infinite, cf. A014090. Subsequence of squares = A053726^2. Subsequence of nonsquares is disjoint union of A020495 and A065377 and so is probably finite. - Vladeta Jovovic, Apr 02 2005
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
I. V. Poljakov, On the exceptional set for the sum of a prime and a perfect square, 1982 Math. USSR Izv. 19 611.
EXAMPLE
5 = 1+4 or 2+3; a prime and a square do not appear together in either sum.
MATHEMATICA
Complement[ Table[ n, {n, 1, 10000} ], Union[ Flatten[ Table[ Prime[ i ] + j^2, {i, 1, 1230}, {j, 1, 100} ] ] ] ]
nspQ[n_]:=Length[Select[IntegerPartitions[n, {2}], (PrimeQ[#[[1]]] && IntegerQ[ Sqrt[ #[[2]]]])||(PrimeQ[#[[2]]]&&IntegerQ[Sqrt[#[[1]]]])&]] == 0; Select[ Range[ 2200], nspQ] (* Harvey P. Dale, Jun 18 2021 *)
PROG
(PARI) list(lim)=my(v=vectorsmall(lim\1, i, 1), u=List(), b); forprime(p=2, #v, b=0; while((t=p+b++^2)<=#v, v[t]=0)); for(i=1, #v, if(v[i], listput(u, i))); Vec(u) \\ Charles R Greathouse IV, May 29 2012
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Axel Harvey, Sep 22 2001
EXTENSIONS
STATUS
approved