2!+
2=4=2
2
3!+
3=9=3
2
4!+
1=25=5
2
5!+
1=121=11
2
6!+
9=729=27
2
7!+
1=5041=71
2
8!+
81=40401=201
2
In the above examples, the number that must be added to each factorial to reach the first perfect square beyond it is itself a perfect square. (With the exception of 2! and 3!)
Make a conjecture about whether the observed pattern continues before you try to prove it or find a counterexample.
(In reply to
re: computer solution by Jer)
These are the values found, looking for any square which when subtracted would leave another square
n n! square square square root
used minus
fact(2x)
1 1 1 0 0 0
4 24 25 1 1 1
5 120 121 1 1 1
6 720 729 9 9 3
7 5040 5041 1 1 1
8 40320 40401 81 81 9
9 362880 363609 729 729 27
10 3628800 3629025 225 225 15
11 39916800 39917124 324 324 18
12 479001600 479084544 82944 82944 288
13 6227020800 6227103744 82944 82944 288
14 87178291200 87178467600 176400 176400 420
15 1307674368000 1307674583296 215296 215296 464
16 20922789888000 20922793332736 3444736 3444736 1856
17 355687428096000 355687529702400 101606400 101606400 10080
18 6402373705728000 6402375900463104 2194735104 2194735104 46848
19 121645100408832000 121645144609689600 44200857600 44200857600 210240
20 2432902008176640000 2432902168432742400 160256102400 160256102400 400320
21 51090942171709440000 51090942597919951104 426210511104 426210511104 652848
22 1124000727777607680000 1124000743711116902400 15933509222400 15933509222400 3991680
23 25852016738884976640000 25852017496697893313604 757812916673604 757812916673604 27528402
24 620448401733239439360000 620448402799862784000000 1066623344640000 1066623344640000 32659200
25 15511210043330985984000000 15511210069996569600000000 26665583616000000 26665583616000000 163296000
26 403291461126605635584000000 403291462434113725338240000 1307508089754240000 1307508089754240000 1143463200
27 10888869450418352160768000000 10888869452122596875481217600 1704244714713217600 1704244714713217600 1305467240
28 304888344611713860501504000000 304888344658506158469212160000 46792297967708160000 46792297967708160000 6840489600
29 8841761993739701954543616000000 8841761993829069963331076531844 89368008787460531844 89368008787460531844 9453465438
At 30 however, the machine became bogged down, having tried many successive squares without finding one which would leave a perfect square difference. This is not to say it would not eventually find one, but at the sizes of these numbers, going through thousands of possible squares is not practical. But it's just that up through 29, the valid squares were found quite quickly.
4 kill "factsq2.txt"
5 open "factsq2.txt" for output as #2
10 for B=1 to 29
20 F=!(B)
30 Sq1=(-int(-sqrt(F)))^2
40 sr= -int(-sqrt(F))
50 good=0
60 repeat
65 prevSq=sq
70 sq=sr*sr
80 sq2=sq-F
90 sr2=int(sqrt(sq2))
100 if sr2*sr2=sq2 then
110 :print b,f,sq,sq-f,sq2,sr2
120 :print #2, b,f,sq,sq-f,sq2,sr2
130 :good=1
140 inc sr
150 until good=1 or sq-prevSq>2*f+2
180 next
190 close #2
|
Posted by Charlie
on 2017-10-20 14:21:05 |