View Single Post
Old 2016-03-15, 23:35   #4
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

2×3×151 Posts
Default

'0011122233445556667788998999' is an simple example.

'9999988877666555443322102101' if you don't like leading zeros.
'9999988877666555220414012313' as one of many thousands of examples.

It's multiset permutations testing primality, but the only tricky bit is that there are a lot and if you're getting them in lexicographic order then you have to plow through a lot of leading zeros. I just reversed it. You could also use one of the many modules/packages/builtins that lets you shuffle an arbitrary deck/bag, if you wanted something more random looking. Loop pulling out random combinations until one is prime.

Last fiddled with by danaj on 2016-03-15 at 23:41
danaj is offline   Reply With Quote