This is the second problem in a new contest in the Brainsteem family. I have noticed a lot of solutions to past problems are given using computational methods. So, just for you, a new series specifically designed to be solved computationally. You may also give analytical solutions as the early ones will be fairly simple.
The Background
Imagine a prime number written in base 10 such that p = d1d2d3d4...dn where each d is a digit and n is the number of digits.
Now think of the sequence of primes such that,
p1 = d1
p2 = d1d2
p3 = d1d2d3
. . .
pn = d1d2d3d4...dn
For example,
p1 = 3
p2 = 31
p3 = 313
p4 = 3137
p5 = 31379
p6 = no primes
So in this case, the maximum prime is p5 with length n=5.
Notice that in this sequence we are adding digits to the right of each prime. It is also possible to add digits to the left, so that we have p = dndn-1...d3d2d1 and, for example, the sequence 3, 13, 313, 3313, and so on.
The Question
Two questions this time.
A. Find the largest possible prime number that can be generated by starting with a single-digit prime and adding digits to the RIGHT of each prime. Let's call this p(max, right).
B. Find the largest possible prime number that can be generated by starting with a single-digit prime and adding digits to the LEFT of each prime. Let's call this p(max, left).
For the First Prize, please include a valid method, algorithm or post the code and output.
If two different people get each of A and B correct, I shall split the First Prize. All others can participate so long as you have done or attempted either A or B.
Remember that even if you are not the first to post, this remains a learning experience that can help in future Brainsteem challenges.
Prizes
To qualify you must upvote this post and write the answer in a comment.
To win First Prize you must include the answer and a valid method.
The First Prize will be 40% of the earnings generated by this post, paid in SBD.
The Second Prize will be 10% of the earnings generated by this post, awarded to any other correct answer in the comments section, chosen at random and paid in SBD.
Also remember that your upvote generates curation rewards for you and that 25% of all earnings are given to upvoters.
Prizes will be awarded after the 7 days have expired. Winners will be announced in the comments below after the draw.
The Prizes will increase with more participation and as the earnings increase.
The main thing is to enjoy the challenge and maybe learn something new.
Come and check out other challenges currently live!
Brainsteem Quickfire Q4 [Win 40% and 10% in SBD]
Brainsteem Compute #1 Prize Computational Maths Puzzle [Win 40% and 10% in SBD]
Brainsteem #8 Prize Maths Puzzle [Win 2SBD+1SBD]
Science Cryptic Crossword SCX1 [Win 10 SBD Prize]
Brainsteem #7 Prize Maths Puzzle [Win 2SBD+1SBD]
Please upvote, resteem and follow @rycharde for more Brainsteems!
I am experimenting with tags, so the easiest way to see all Brainsteems is to follow me. Thanks.
And don't forget to upvote each other's comments to bring cheer to the whole community!
Oh boys thats a lot of computational power, lemme do this now :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Q1: 73939133
matlab:
plist = 1:10;
plistn = 1:10;
for i = 1:20
plist = plistn;
plist = plist(isprime(plist));
plist = plist *10;
end
max(plist/10)
isprime(max(plist)/10)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Oh, just found out they are called truncatable primes and proved myself to be correct :)
congrats to me ;3; (so lonely)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
:-) In the other direction they are called nested primes.
I have a follow-up planned for this: can you guess the question?
Of course I disguise what things are called - otherwise everyone would just search for the answer.
I also don't always know the answer! ;-) Sometimes there will be challenges that are like little projects.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I did accidentally found out smth during the solving process:)
is it to find the largest emirp ^^?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Well, you found that already, didn't you? :-)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Yes :)
accidentally XD
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
But that's good, isn't it?!
The next question will be fun!
But you're now a famous app dev!!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
XDDD thx for the attention~
im ready for the next one >:3
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @rycharde! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes
Click on any badge to view your own Board of Honnor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
By upvoting this notification, you can help all Steemit users. Learn how here!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit