Skip to main content
added 1 character in body
Source Link
H.PWiz
  • 11.6k
  • 2
  • 22
  • 56

Brachylog, 12 bytes

{^a₀.&b~b^}ᶜ

Try it online!

Explanation

{^a₀.&b~b^}ᶜ
{         }ᶜ  Count the number of ways the following can succeed:
  a₀            A prefix of
 ^                the first {input} to the power of the second {input}
    .&          produces the same output with the same input as
       ~b         any number
         ^        to the power of
      b           all inputs but the lastfirst (i.e. the second input)

Brachylog, 12 bytes

{^a₀.&b~b^}ᶜ

Try it online!

Explanation

{^a₀.&b~b^}ᶜ
{         }ᶜ  Count the number of ways the following can succeed:
  a₀            A prefix of
 ^                the first {input} to the power of the second {input}
    .&          produces the same output with the same input as
       ~b         any number
         ^        to the power of
      b           all inputs but the last (i.e. the second input)

Brachylog, 12 bytes

{^a₀.&b~b^}ᶜ

Try it online!

Explanation

{^a₀.&b~b^}ᶜ
{         }ᶜ  Count the number of ways the following can succeed:
  a₀            A prefix of
 ^                the first {input} to the power of the second {input}
    .&          produces the same output with the same input as
       ~b         any number
         ^        to the power of
      b           all inputs but the first (i.e. the second input)
Post Made Community Wiki
Source Link
ais523
  • 11
  • 19
  • 35

Brachylog, 12 bytes

{^a₀.&b~b^}ᶜ

Try it online!

Explanation

{^a₀.&b~b^}ᶜ
{         }ᶜ  Count the number of ways the following can succeed:
  a₀            A prefix of
 ^                the first {input} to the power of the second {input}
    .&          produces the same output with the same input as
       ~b         any number
         ^        to the power of
      b           all inputs but the last (i.e. the second input)