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.

A078897 Number of times the greatest prime factor of n is a factor in all numbers <=n; a(1)=1.

Original entry on oeis.org

1, 1, 1, 3, 1, 2, 1, 7, 4, 2, 1, 5, 1, 2, 3, 15, 1, 8, 1, 4, 3, 2, 1, 10, 6, 2, 13, 4, 1, 7, 1, 31, 3, 2, 5, 17, 1, 2, 3, 9, 1, 6, 1, 4, 10, 2, 1, 22, 8, 12, 3, 4, 1, 26, 5, 9, 3, 2, 1, 14, 1, 2, 10, 63, 5, 6, 1, 4, 3, 11, 1, 34, 1, 2, 18, 4, 7, 6, 1, 19, 40, 2, 1, 13, 5, 2, 3, 8, 1, 21, 7, 4, 3, 2, 5
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2002

Keywords

Comments

For n>1: a(n) = 1 iff n is prime.
a(n) = A078896(n) iff n is a prime power (A000961).

Crossrefs

Programs

  • Maple
    f:= proc(n) local p;
      p:= max(numtheory:-factorset(n));
      add(padic:-ordp(k,p),k=1..n);
    end proc:
    1, seq(f(n), n=2..1000); # Robert Israel, Dec 23 2014
  • Mathematica
    a[1] = 1; a[n_] := With[{p = FactorInteger[n][[-1, 1]]}, IntegerExponent[ Range[n], p] // Total]; Array[a, 100] (* Jean-François Alcover, Mar 09 2019 *)
  • PARI
    a(n) = if (n==1, 1, my(p = vecmax(factor(n)[,1])); sum(i=1, n, valuation(i, p))); \\ Michel Marcus, Dec 23 2014, Mar 09 2019