A264890 Integers k such that k! + 1 is the sum of 2 nonzero squares.
0, 1, 4, 8, 11, 12, 17, 25, 26, 27, 28, 29, 37, 38, 41, 45, 48, 54, 60, 67, 71, 73, 75, 77, 88, 92, 94, 114, 115, 116, 119, 133
Offset: 1
Examples
a(3) = 4 because 4! + 1 = 4^2 + 3^2.
Programs
-
Mathematica
Flatten@ Position[Map[Length, Map[Map[Length, PowersRepresentations[#, 2, 2] &@(#! + 1) /. 0 -> Nothing] &, Range[0, 48]] /. 1 -> Nothing], n_ /; n > 0] - 1 (* Michael De Vlieger, Nov 28 2015 *)
-
PARI
is(n) = { for(i=1, #n=factor(n!+1)~%4, n[1, i]==3 && n[2, i]%2 && return); n && (vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2)) }
Extensions
a(25)-a(32) from Jinyuan Wang, May 22 2021