A162681 Numbers k such that k^2 is a sum of three factorials.
2, 3, 6, 7, 29, 72
Offset: 1
Keywords
Examples
2^2 = 1! + 1! + 2!; 3^2 = 1! + 2! + 3!; 6^2 = 3! + 3! + 4!; 7^2 = 1! + 4! + 4!; 29^2 = 1! + 5! + 6!; 72^2 = 4! + 5! + 7!.
Programs
-
Maple
s := 10^40 ; sqr := s^2 : for a from 1 do if a! > sqr then break; fi; for b from a do if a!+b! > sqr then break; fi; for c from b do if a!+b!+c! > sqr then break; fi; if issqr(a!+b!+c!) then print( sqrt(a!+b!+c!)); fi; od: od: od: # R. J. Mathar, Jul 16 2009 w := 7: f := proc (x, y, z) options operator, arrow: sqrt(factorial(x)+factorial(y)+factorial(z)) end proc: A := {}: for x to w do for y to w do for z to w do if type(f(x, y, z), integer) = true then A := `union`(A, {f(x, y, z)}) else end if end do end do end do: A; # Emeric Deutsch, Aug 03 2009
-
Mathematica
$MaxExtraPrecision=Infinity; lst={};Do[Do[Do[x=(a!+b!+c!)^(1/2);If[x==IntegerPart[x], AppendTo[lst,x]],{c,b,2*4!}],{b,a,2*4!}],{a,2*4!}];Union[lst]
Extensions
Definition rephrased by R. J. Mathar, Jul 16 2009
Comments