A332029 a(n) is the least number k > 0 such that n^k - (n mod 2) - 1 is prime, or 0 if no such number exists.
0, 2, 2, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 6, 1, 1, 1, 1, 0, 24, 1, 1, 0, 2, 0, 2, 1, 1, 1, 1, 0, 2, 0, 2, 1, 1, 0, 4, 1, 1, 1, 1, 0, 2, 1, 1, 0, 8, 0, 4, 1, 1, 0, 12, 0, 4, 1, 1, 1, 1, 0, 8, 0, 3, 1, 1, 0, 2, 1, 1, 1, 1, 0, 2, 0, 38, 1, 1, 0, 4, 1, 1, 0, 4
Offset: 1
Keywords
Formula
a(n) = 0 for n in A238204. - Michel Marcus, Feb 08 2020 [Proof: a(n) = 1 iff n - 1 is a prime because n^k - 1 is divisible by n - 1, where k > 1 and n is an even number greater than 2. But if n is a term in A238204, n - m is prime only for some m >= 3. Therefore, a(n) = 0 for n in A238204. - Jinyuan Wang, Feb 08 2020]
Extensions
More terms from Jinyuan Wang, Feb 07 2020