login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A078897
Number of times the greatest prime factor of n is a factor in all numbers <=n; a(1)=1.
4
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,4
COMMENTS
For n>1: a(n) = 1 iff n is prime.
a(n) = A078896(n) iff n is a prime power (A000961).
LINKS
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Dec 12 2002
STATUS
approved