OFFSET
1,3
COMMENTS
Motivation for this sequence is the equation n! = x^2 + y^2 + z^2 where x, y and z are integers.
The asymptotic density of this sequence is 7/8 (Deshouillers and Luca, 2010). - Amiram Eldar, Jan 11 2021
LINKS
Jean-Marc Deshouillers and Florian Luca, How often is n! a sum of three squares?, in: The legacy of Alladi Ramakrishnan in the mathematical sciences, Springer, New York, 2010, pp. 243-251.
EXAMPLE
0 is a term because 0! = 1 = 0^2 + 0^2 + 1^2.
2 is a term because 2! = 2 = 0^2 + 1^2 + 1^2.
3 is a term because 3! = 6 = 1^2 + 1^2 + 2^2.
6 is a term because 6! = 720 = 0^2 + 12^2 + 24^2.
MATHEMATICA
Select[Range[0, 18], SquaresR[3, #!] > 0 &] (* Michael De Vlieger, Jan 13 2016 *)
PROG
(PARI) isA004215(n) = { my(fouri, j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri -7 ; if( j % 8 ==0, return(1) ) ; ) ; fouri *= 4 ; ) ; return(0) ; } { for(n=1, 400, if(isA004215(n), print1(n, ", ") ; ) ; ) ; }
for(n=0, 1e2, if(!isA004215(n!), print1(n, ", ")));
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jan 12 2016
STATUS
approved