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.

A087040 2nd largest prime factor of n-th composite number.

Original entry on oeis.org

2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 5, 2, 3, 2, 3, 2, 3, 2, 5, 3, 2, 3, 2, 3, 2, 3, 2, 2, 7, 5, 3, 2, 3, 5, 2, 3, 2, 3, 2, 3, 2, 5, 3, 2, 3, 5, 3, 2, 5, 2, 7, 3, 2, 3, 2, 3, 5, 2, 3, 2, 3, 7, 2, 3, 2, 5, 2, 7, 3, 5, 3, 2, 5, 2, 3, 5, 3, 2, 3, 5, 2, 3, 2, 7, 3, 11, 2, 3, 2, 5, 3, 2, 3, 5, 3, 7, 2, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 01 2003

Keywords

Comments

a(n) = A087039(A002808(n));
a(n) = A006530(A002808(n)/A052369(n)).

Crossrefs

Programs

  • Maple
    f:= proc(n) local F;
      if isprime(n) then return NULL fi;
      F:= sort(ifactors(n)[2],(a,b) -> a[1]>b[1]);
      if F[1][2] >= 2 then F[1][1] else F[2][1] fi
    end proc:
    map(f, [$2..200]); # Robert Israel, Feb 20 2024
  • Mathematica
    Table[l=FactorInteger[ResourceFunction["Composite"][n]];If[Last[l][[2]]>1,Last[l][[1]],First[Part[l,-2]]],{n,102}] (* James C. McMahon, Feb 20 2024 *)