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

Home > Numbers
Composite prime (Posted on 2015-02-24) Difficulty: 1 of 5
What is the smallest prime number such that all of its digits are composite?

See The Solution Submitted by Math Man    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution smallest and beyond--computer exploration (spoiler) Comment 2 of 2 |
From the first 1000 primes: The ordinality of the prime is followed by the prime itself:

24 89
87 449
95 499
628 4649
654 4889
665 4969
669 4999
837 6449
839 6469
862 6689
884 6869
887 6899
892 6949

from

DefDbl A-Z
Dim  crlf$


Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 
 For n = 2 To 1000
   s = LTrim(Str(prm(n)))
   good = 1
   For i = 1 To Len(s)
     If InStr("4689", Mid(s, i, 1)) = 0 Then good = 0
   Next
   If good Then Text1.Text = Text1.Text & n & Str(prm(n)) & crlf
 Next
 Text1.Text = Text1.Text & crlf & crlf & ct
 
 End Sub
 
Function prm(i)
  Dim p As Long
  Open "17-bit primes.bin" For Random As #111 Len = 4
  Get #111, i, p
  prm = p
  Close 111
End Function

  Posted by Charlie on 2015-02-24 11:11:57
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