Actually, 6 bytes
This answer is based on xnor's algorithm in Martin Ender's Jelly answer xnor's algorithm in Martin Ender's Jelly answer. Golfing suggestions welcome. Try it online!
▒D├♂≈π
How it works
Implicit input n.
▒ totient(n)
D Decrement.
├ Convert to binary (as string).
♂≈ Convert each char into an int.
π Take the product of those binary digits.
If the result is 1,
then bin(totient(n) - 1) is a string of 1s, and totient(n) is power of two.
Actually, 6 bytes
This answer is based on xnor's algorithm in Martin Ender's Jelly answer. Golfing suggestions welcome. Try it online!
▒D├♂≈π
How it works
Implicit input n.
▒ totient(n)
D Decrement.
├ Convert to binary (as string).
♂≈ Convert each char into an int.
π Take the product of those binary digits.
If the result is 1,
then bin(totient(n) - 1) is a string of 1s, and totient(n) is power of two.
Actually, 6 bytes
This answer is based on xnor's algorithm in Martin Ender's Jelly answer. Golfing suggestions welcome. Try it online!
▒D├♂≈π
How it works
Implicit input n.
▒ totient(n)
D Decrement.
├ Convert to binary (as string).
♂≈ Convert each char into an int.
π Take the product of those binary digits.
If the result is 1,
then bin(totient(n) - 1) is a string of 1s, and totient(n) is power of two.
Actually, 6 bytes
This answer is based on xnor's algorithm in Martin Ender's Jelly answer. Golfing suggestions welcome. Try it online!
▒D├♂≈π
How it works
Implicit input n.
▒ totient(n)
D Decrement.
├ Convert to binary (as string).
♂≈ Convert each char into an int.
π Take the product of those binary digits.
If the result is 1,
then bin(totient(n) - 1) is a string of 1s, and totient(n) is power of two.