|
|
A359013
|
|
Numbers k that can be written as the sum of a perfect square and a factorial in exactly 3 distinct ways.
|
|
0
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
This does not count x^2 and (-x)^2 as distinct, nor does it count 0! and 1! as distinct.
|
|
LINKS
|
|
|
EXAMPLE
|
145 = 5^2 + 5! = 11^2 + 4! = 12^2 + 1!.
|
|
PROG
|
(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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,hard,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|