22
2
Satan-Primes
who are they?
they are Primes
containing 666
these are Satan-Primes:[46663,266677,666599,666683,616669]
these are NOT :[462667,665669,36363631,555]
Plot
Every number bigger than 6661 has Satan-Primes behind him
The Challenge
Given an integer n>6661
find the Satan-Prime behind (or equal) and closest to itself.
Examples
Integer n=30000
has 3 Satan-Primes(SP) behind it:[6661, 16661, 26669]
.
Your code must return 26669
which is the closest behind it
Test Cases
Input->Output
6662->6661
10000->6661
66697->66697 (a SP returns himself)
328765->326663
678987->676661
969696->966677
Rules
Yor code should work for any n
in the range of your language.
This is code-golf, so the shortest answer in bytes wins!
1define "about a minute." Is it +- 30 seconds? I personally think that 30 minutes and a minute don't differ that much... Also bonuses are generally frowned upon... also I think this might have been better as an
output the nth satan prime
challenge... – Socratic Phoenix – 2017-08-25T16:47:26.113ok ok people... bonus will be removed... – None – 2017-08-25T16:51:26.310
Hope you don't mind the edit I made to the challenge title. – Shaggy – 2017-08-25T17:29:39.857
3@Shaggy What point does the title change serve...? – Conor O'Brien – 2017-08-26T01:40:28.630
3@ConorO'Brien Rhyming and appearing archaic, I presume. – wizzwizz4 – 2017-08-26T15:17:28.760