cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A283461 Second-largest prime factor of 2^n - 1, if composite, or 1 otherwise.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

For clarification: if the largest prime factor occurs more than once, then that prime factor is selected.

Crossrefs

Programs

  • 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 *)
  • 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))

Formula

a(n) = A006530(A000225(n)/A005420(n)).