A359013 Numbers k that can be written as the sum of a perfect square and a factorial in exactly 3 distinct ways.
145, 46249, 63121, 42916624, 18700677890064, 28112213204100, 41654823930457982576640000, 445860623276908458083942400, 666474080134036599385635225600
Offset: 1
Examples
145 = 5^2 + 5! = 11^2 + 4! = 12^2 + 1!.
Programs
-
Python
import math for x in range(1, 120000000): total = 0 prod = 1 factInc = 2 while prod <= x: sq = math.sqrt(x - prod) if sq % 1 == 0: total = total + 1 prod = prod * factInc factInc = factInc + 1 if total == 3: print(x)
Extensions
a(5)-a(9) from David A. Corneth, Dec 11 2022
Comments