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

Home > Just Math
Reverse Rigor II (Posted on 2014-07-22) Difficulty: 3 of 5
Denote by R(N) the integer obtained by reversing the digits of a positive integer N.

Determine the largest integer that is certain to divide N4 - (R(N))4, with N > R(N), regardless of the choice of N.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts possible computer solution | Comment 1 of 4
DefDbl A-Z
Dim crlf$, sofar


Private Sub Form_Load()
 ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents
 
 For n = 10 To 10000
  rn = reverse(n)
  If n > rn Then
   If flag = 0 Then
    sofar = n - rn
    flag = 1
   Else
    sofar = gcd(sofar, n - rn)
   End If
   Text1.Text = Text1.Text & Str(n) & Str(rn) & Str(sofar) & crlf
   DoEvents
  End If
 Next
 
 
 Text1.Text = Text1.Text & crlf & "done"
End Sub

Function reverse(n)
  s$ = LTrim(Str(n))
  v = 0
  For i = Len(s$) To 1 Step -1
    v = 10 * v + Val(Mid(s$, i, 1))
  Next
  reverse = v
End Function

Function gcd(a, b)
  x = a: y = b
  Do
   q = Int(x / y)
   z = x - q * y
   x = y: y = z
  Loop Until z = 0
  gcd = x
End Function

finds the GCD among the formulas coming from all N tested as 9.


  Posted by Charlie on 2014-07-22 11:58:31
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
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