3 lines
49 B
Ruby
3 lines
49 B
Ruby
def isprime(n)
|
|
'1'*n !~ /^1?$|^(11+?)\1+$/
|
|
end
|
def isprime(n)
|
|
'1'*n !~ /^1?$|^(11+?)\1+$/
|
|
end
|