Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

3 of 7
added 1 character in body
Shaggy
  • 45k
  • 4
  • 39
  • 95

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×ばつ

Try it

Ë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

AltStyle によって変換されたページ (->オリジナル) /