A078896 Number of times the smallest prime factor of n is a factor in all numbers <= n; a(1) = 1.
1, 1, 1, 3, 1, 4, 1, 7, 4, 8, 1, 10, 1, 11, 6, 15, 1, 16, 1, 18, 9, 19, 1, 22, 6, 23, 13, 25, 1, 26, 1, 31, 15, 32, 8, 34, 1, 35, 18, 38, 1, 39, 1, 41, 21, 42, 1, 46, 8, 47, 23, 49, 1, 50, 13, 53, 27, 54, 1, 56, 1, 57, 30, 63, 15, 64, 1, 66, 32, 67, 1, 70, 1, 71, 35, 73, 12, 74, 1, 78, 40
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Programs
-
Mathematica
With[{s = Array[Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger[#]] &, 81]}, Array[Count[Take[s, #1], #2, 2] & @@ {#, s[[#, 1]]} &, Length@ s]] (* Michael De Vlieger, Dec 16 2017 *)
-
PARI
a(n) = if (n==1, 1, my(p = factor(n)[1, 1]); sum(i=1, n, valuation(i, p))); \\ Michel Marcus, Dec 27 2014
Formula
For n>1, a(n) = 1 iff n is prime.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{p prime} (1/(p*(p-1))) * Product_{primes q < p} (1-1/q) = 0.6125177915489... . - Amiram Eldar, May 14 2025