OFFSET
1,1
LINKS
Carlos Rivera, Puzzle 1116. A358527, The Prime Puzzles & Problems Connection.
EXAMPLE
M(5) = 15 = 3*5 and 5 is in second position in the prime factorization of M(5), and no lesser odd prime satisfies this, so a(2) = 5.
M(17) = 65535 = 3*5*17*257 and 17 is in third position in the prime factorization of M(17), and no lesser odd prime satisfies this, so a(3) = 17.
MATHEMATICA
f[n_] := Module[{p = Prime[n]}, Count[Prime[Range[n - 1]], _?(PowerMod[2, p - 1, #] == 1 &)] + 1]; f[1] = 0; With[{s = Array[f, 4000]}, ind = TakeWhile[ FirstPosition[s, #] & /@ Range[Max[s]] // Flatten, NumberQ ]; Prime[ind]] (* Amiram Eldar, Jan 02 2023 *)
PROG
(PARI) isok(p, n) = my(f=factor(2^(p-1) - 1, p+1)); if (#f~ < n, 0, f[n, 1] == p);
a(n) = my(p=3); while(!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Jan 13 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Dec 31 2022
STATUS
approved