Skip to main content
3 of 6
add decimal version
ThaddeusB
  • 401
  • 2
  • 8

#Perl, 23 bytes

say<>=~/^(?!(..+)\1+$)/

Using the regular expression+unary input approach, prints 11 (or whatever your digit entered) or a blank line

Bonus: decimal version, 32 bytes

(1x<>)=~/^1?$|^(11+)\1+$/||say 1
ThaddeusB
  • 401
  • 2
  • 8