One-two primes: Difference between revisions

m
→‎Generalized: Fix a few links, typos
m (fix bad header markup)
m (→‎Generalized: Fix a few links, typos)
Line 481:
* [[oeis:A036930|OEIS:A036930 - Smallest n digit prime using only 1 and 3 (or '0' if none exists)]]
* [[oeis:A036931|OEIS:A036931 - Smallest n digit prime using only 1 and 4 (or '0' if none exists)]]
* [[oeis:A036932|OEIS:A036932 - Smallest n digit prime using only 1 and 75 (or '0' if none exists)]]
* [[oeis:A036933|OEIS:A036933 - Smallest n digit prime using only 1 and 6 (or '0' if none exists)]]
* [[oeis:A036939A036934|OEIS:A036939A036934 - Smallest n digit prime using only 1 and 97 (or '0' if none exists)]]
* [[oeis:A036935|OEIS:A036935 - Smallest n digit prime using only 1 and 8 (or '0' if none exists)]]
* [[oeis:A036936|OEIS:A036936 - Smallest n digit prime using only 1 and 9 (or '0' if none exists)]]
* [[oeis:A036937|OEIS:A036937 - Smallest n digit prime using only 2 and 3 (or '0' if none exists)]]
* [[oeis:A036938|OEIS:A036938 - Smallest n digit prime using only 2 and 7 (or '0' if none exists)]]
Line 502 ⟶ 504:
Really, the only one that is a little tricky is the first one (0,1). That one required some specialized logic. All of the rest would work with the task specific version with different hard coded digits.
 
Limited the stretch to keep the run time reasonable. Finishes all 22 in underaround 1012 seconds on my system.
 
<syntaxhighlight lang="raku" line>for 929,(0,1),
229,(1,2),930,(1,3),931,(1,4),932,(1,5),933,(1,6),939934,(1,7),935,(1,8),936,(1,9),
937,(2,3),938,(2,7),939,(2,9),
940,(3,4),941,(3,5),942,(3,7),943,(3,8),
10,333

edits