OFFSET
1,1
COMMENTS
Note that p = a^2 + b^2 and 2p = (a+b)^2 + (a-b)^2 is the only way. So according to the definition the greedy algorithm cannot give such the sums of two squares.
Primes p == 1 (mod 4) such that A245474(p) > 2.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10461 (first 46 terms from Thomas Ordowski and Colin Barker)
MATHEMATICA
a245440Q[n_Integer] := If[
And[PrimeQ[n] == True, Mod[n, 4] == 1],
If[Or[IntegerQ[Sqrt[n - Floor[Sqrt[n]]^2]] == True,
IntegerQ[Sqrt[2*n - Floor[Sqrt[2*n]]^2]] == True], False, True],
False]; a245440[n_Integer] :=
Flatten[Position[Thread[a245440Q[Range[n]]],
True]]; a245440[300000]; (* Michael De Vlieger, Aug 05 2014 *)
PROG
(PARI) s=[]; forprime(p=2, 3000, if(p%4==1 && !issquare(p-floor(sqrt(p))^2) && !issquare(2*p-floor(sqrt(2*p))^2), s=concat(s, p))); s \\ Colin Barker, Jul 22 2014
(Magma) [p: p in PrimesUpTo(10000) | p mod 4 eq 1 and not IsSquare(p-Floor(Sqrt(p))^2) and not IsSquare(2*p-Floor(Sqrt(2*p))^2)]; // Vincenzo Librandi, Sep 19 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Jul 22 2014
EXTENSIONS
More terms from Colin Barker, Jul 22 2014
STATUS
approved