Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.7K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Find primes that contain in their decimal representation the sequence 2015?

Posted 9 years ago

Solve problem: Among the first 50000 simple numbers find those that contain in their decimal representation the sequence 2015 (the smallest number with this property is 120157).

POSTED BY: Tereza Lion
3 Replies
Posted 9 years ago
Prime[50000]


M[n_] = 2 10^5 + 0 10^4 + 1 10^3 + 5 10^2 + n
Do[If[PrimeQ[M[n]], Print[M[n]]], {n, 1, 99}]


M[p_, q_] = p 10^5 + 2 10^4 + 0 10^3 + 1 10^2 + 6 10 + q
Do[If[PrimeQ[M[p, q]], Print[M[p, q]]], {p, 1, 5}, {q, 1, 9}]
POSTED BY: Tereza Lion
Posted 9 years ago
POSTED BY: Tereza Lion
POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard