All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Some sums (Posted on 2015-04-07) Difficulty: 3 of 5
Consider the two equalities:
1!+5! = 11^2
4!+5! = 12^2

Is there a pair of successive integers (below 1000) such that their squares can be written as a sum of 2 factorials?

See The Solution Submitted by Ady TZIDON    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 2 of 3 |
18! is a 16-digit number, so checking the sums of pairs of factorials up to that of 18 for whether the sum is a square will be sufficient. Only five cases of sums of two factorials result in perfect squares:

a b   sqrt  a!+b!
1 4      5    25
1 5     11   121
1 7     71  5041
2 2      2     4
4 5     12   144

In the sqrt column (that is, the square root of the sum of factorials), only two of the numbers are successive: the 11 and 12 of the original set from the puzzle.


 For a = 1 To 18
  For b = a To 18
    tot = fact(a) + fact(b)
    sr = Int(Sqr(tot) + 0.5)
    If sr * sr = tot Then
     Text1.Text = Text1.Text & a & Str(b) & "     " & sr & Str(sr * sr) & crlf
     DoEvents
    End If
  Next
 Next


Function fact(x)
  f = 1
  For i = 2 To x
   f = f * i
  Next
  fact = f
End Function

Of course, upon reading Dej Mar's answer, I realize I neglected the negative square roots.


  Posted by Charlie on 2015-04-07 14:34:22
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (21)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information