Find all pairs (n, t) of positive integers that satisfy the equation:
(n+1)t - 1 = n!
Provide adequate reasoning for your answer.
I found 3 solutions, have not proved there are no others.
(n,t) (n+1)^t n!
(1,1) 2 1
(2,1) 3 2
(4,2) 25 24
---------------------------
def fac(n):
""" Factorial """
if n == 1 or n == 0:
return 1
else:
return n*fac(n-1)
print('(n,t) (n+1)^t n!')
big = 300
for n in range(1,big):
for t in range(1,big):
if (n+1)**t - 1 == fac(n):
print('({},{}) {} {}'.format(n,t, (n+1)**t, fac(n)))
|
Posted by Larry
on 2023-04-03 12:58:48 |