I'm trying to make a program that calculates Brown numbers, or numbers that can be expressed as n!+1 = m^2
where m is an integer, and running this through creates too big of a number.
Any idea how to fix this? (There is also an abacist style method but it takes exponentially longer)
n = 40320
f = 9
while True:
x = (n+1)**(.5)
if isinstance( x, int ):
break
else:
n = n*f
f = f+1
print(f)
print(n)
print(input(" "))
*n is 8!