Find squares n where n 1 is prime
1..1000.isqrt -> map { _**2 }.grep { is_prime(_+1) }.say
Output:
[1, 4, 16, 36, 100, 196, 256, 400, 576, 676]
Last updated
Was this helpful?
1..1000.isqrt -> map { _**2 }.grep { is_prime(_+1) }.say
[1, 4, 16, 36, 100, 196, 256, 400, 576, 676]
Last updated
Was this helpful?