login
A283461
Second-largest prime factor of 2^n - 1, if composite, or 1 otherwise.
1
1, 1, 3, 1, 3, 1, 5, 7, 11, 23, 7, 1, 43, 31, 17, 1, 19, 1, 31, 127, 89, 47, 17, 601, 2731, 73, 113, 1103, 151, 1, 257, 89, 43691, 127, 73, 223, 174763, 8191, 41, 13367, 337, 9719, 683, 631, 178481, 4513, 257, 127, 1801, 11119, 2731
OFFSET
2,3
COMMENTS
For clarification: if the largest prime factor occurs more than once, then that prime factor is selected.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..1206
FORMULA
a(n) = A006530(A000225(n)/A005420(n)).
MATHEMATICA
a[n_] := If[PrimeQ[2^n-1], 1, Block[{f = FactorInteger[2^n-1]}, If[f[[-1, 2]] == 1, f[[-2, 1]], f[[-1, 1]]]]]; a /@ Range[2, 52] (* Giovanni Resta, Mar 08 2017 *)
PROG
(PARI) a(n)=my(f=factor(2^n-1), t=#f~); if(f[t, 2]>1, f[t, 1], if(t>1, f[t-1, 1], 1))
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved