OFFSET
1,1
COMMENTS
The formula 2nk+1 is used to find trivial factors of Mersenne(p). Here it is used for all exponents (prime exponents and not prime exponents).
Mersenne primes of A000043 can be found in this sequence too (except for 2). E.g.: a(1, 3, 9, 315, 3855, 13797) = A000043(2..7).
If n mod 4 = 2 then a(n) must be composite.
LINKS
Karl-Heinz Hofmann, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 15: 2^15 - 1 = 32767; 2*5*15 + 1 = 151; 32767 mod 151 = 0, and there are no numbers < 15 which satisfy the requirement for n = 5.
MATHEMATICA
a[n_] := Module[{k = 1}, While[PowerMod[2, k, 2*n*k + 1] != 1, k++]; k]; Array[a, 62] (* Amiram Eldar, Feb 03 2022 *)
PROG
(Python)
def A350703(k, expo):
while pow(2, expo, 2*k*expo+1) != 1: expo += 1
return expo
print([A350703(k, 1) for k in range(1, 63)])
(PARI) a(n) = my(k=1); while (Mod(2, 2*n*k+1)^k != 1, k++); k; \\ Michel Marcus, Feb 03 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Karl-Heinz Hofmann, Feb 03 2022
STATUS
approved