Japt, 26 bytes
Ew! Don't think I've ever been more jealous of languages with built-ins for lists of primes and exponents and what-not :\
Ën"0s~|A()" ÑÄÃí!p_j}jUl×ばつ
Ën"..." ÑÄÃí!p_j}jUl×ばつ :Implicit input of character array U
Ë :Map
n"..." : Convert from base "0s~|A()" to base-10 integer
Ñ : Multiply by 2
Ä : Add 1
à :End map
í :Interleave with
!p :And reduce each pair by inverse exponentiation
_ : Function taking an integer as argument
j : Is prime?
} : End function
j : Generate an array of integers that return true of length
Ul : Length of U
1 :End interleave
×ばつ :Reduce by multiplication
Shaggy
- 45k
- 4
- 39
- 95