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

Home > Numbers
Only prime digits allowed (Posted on 2019-01-31) Difficulty: 3 of 5
List all the integers containing only prime-digits such that their squares also contain prime-digits only.

Hint: The highest qualifying number is below 77777.

Source: Claudio Meller's site.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 2
Checked up to 30 million anyway; indeed all found are below 77777.

Each number is shown with its square:

5  25
235  55225
72335  5232352225

DefDbl A-Z
Dim crlf$

Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 
 Form1.Visible = True
 
 For n = 2 To 30000000
   n2 = n * n
   tst$ = LTrim(Str(n)) + LTrim(Str(n2))
   good = 1
   For i = 1 To Len(tst)
     If InStr("2357", Mid(tst, i, 1)) = 0 Then good = 0: Exit For
   Next
   If good Then Text1.Text = Text1.Text & n & Str(n2) & crlf
   DoEvents
 Next
 
 Text1.Text = Text1.Text & "done"
 
End Sub


  Posted by Charlie on 2019-01-31 15:57:31
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 (10)
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