OFFSET
1,1
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 2 since prime(1) = gpf(prime(2) - 1), i.e., 2 = gpf(2).
a(2) = 4 since prime(2) = gpf(prime(4) - 1), i.e., 3 = gpf(6).
a(3) = 5 since prime(3) = gpf(prime(5) - 1), i.e., 5 = gpf(10).
a(4) = 10 since prime(4) = gpf(prime(10) - 1), i.e., 7 = gpf(28).
MATHEMATICA
With[{s = Array[FactorInteger[Prime@ # - 1][[-1, 1]] &, 1000]}, Reap[Do[If[FreeQ[s, #], Break[], Sow@ FirstPosition[s, #][[1]]] &@ Prime@ i, {i, Length@ s}]][[-1, -1]]]
PROG
(PARI) { a = vector(60); pr = primes(#a); u = 1; n = 1;
forprime (p=3, oo, n++; f=factor(p-1); g=setsearch(pr, f[#f~, 1]);
if (g && !a[g], a[g]=n; while (a[u], print1 (a[u]", "); u++; if (u>#a, break (2))))) } \\ Rémy Sigrist, May 28 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger, Apr 29 2019
STATUS
approved