Pushy, 7 bytes
oBoIpP#
This takes advantage of the fact that mersenne numbers have only ones in their binary representation:
oB \ Pop input, push its binary digits.
oI \ Re-push the input
p \ Test its primality (0/1)
P# \ Print the product of the stack
The stack product will only be 1 if the number has no zeroes in its binary representation, and its primality evaluates tois 1True (True).
Pushy, 7 bytes
oBoIpP#
This takes advantage of the fact that mersenne numbers have only ones in their binary representation:
oB \ Pop input, push its binary digits.
oI \ Re-push the input
p \ Test its primality (0/1)
P# \ Print the product of the stack
The stack product will only be 1 if the number has no zeroes in its binary representation, and its primality evaluates to 1 (True).
Pushy, 7 bytes
oBoIpP#
This takes advantage of the fact that mersenne numbers have only ones in their binary representation:
oB \ Pop input, push its binary digits.
oI \ Re-push the input
p \ Test its primality (0/1)
P# \ Print the product of the stack
The stack product will only be 1 if the number has no zeroes in its binary representation, and its primality is True.
Pushy, 7 bytes
oBoIpP#
This takes advantage of the fact that mersenne numbers have only ones in their binary representation:
oB \ Pop input, push its binary digits.
oI \ Re-push the input
p \ Test its primality (0/1)
P# \ Print the product of the stack
The stack product will only be 1 if the number has no zeroes in its binary representation, and its primality evaluates to 1 (True).