A384656 a(n) = Sum_{k=1..n} A051903(ugcd(n,k)), where ugcd(n,k) is the greatest divisor of k that is a unitary divisor of n.
0, 1, 1, 2, 1, 4, 1, 3, 2, 6, 1, 9, 1, 8, 7, 4, 1, 12, 1, 13, 9, 12, 1, 16, 2, 14, 3, 17, 1, 22, 1, 5, 13, 18, 11, 24, 1, 20, 15, 22, 1, 30, 1, 25, 18, 24, 1, 27, 2, 28, 19, 29, 1, 32, 15, 28, 21, 30, 1, 51, 1, 32, 22, 6, 17, 46, 1, 37, 25, 46, 1, 41, 1, 38, 30
Offset: 1
Keywords
Examples
a(4) = A051903(ugcd(4,1)) + A051903(ugcd(4,2)) + A051903(ugcd(4,3)) + A051903(ugcd(4,4)) = A051903(1) + A051903(1) + A051903(1) + A051903(4) = 0 + 0 + 0 + 2 = 2.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
f[p_, e_, k_] := p^e - If[e < k, 0, 1]; a[n_] := Module[{fct = FactorInteger[n], emax, s}, emax = Max[fct[[;; , 2]]]; s = emax * n; Do[s -= Times @@ (f[#1, #2, k] & @@@ fct), {k, 1, emax}]; s]; a[1] = 0; Array[a, 100]
-
PARI
a(n) = if(n == 1, 0, my(f = factor(n), p = f[,1], e = f[,2], emax = vecmax(e), s = emax*n); for(k = 1, emax, s -= prod(i = 1, #p, p[i]^e[i] - if(e[i] < k, 0, 1))); s);
Formula
a(n) = Sum_{k=1..A051903(n)} (n - f(n, k)) = A051903(n) * n - Sum_{k=1..A051903(n)} f(n, k), where f(n, k) is multiplicative for a given k, with f(p^e, k) = p^e - 1 if e >= k and f(p^e, k) = p^e if e < k.
a(n) = 1 if and only if n is prime.
a(n) >= 2 if and only if n is composite.
a(n) >= 2*n - A047994(n) - A384048(n) with equality if and only if n is cubefree that is not squarefree (i.e., n in A067259, or equivalently, A051903(n) = 2).
a(n) < 5*n/4 and lim sun_{n->oo} a(n)/n = 5/4.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum{k>=1} (1 - Product_{p prime} (1 - 1/(p^(2*k-1)*(p+1)))) = 0.36292303251495264373... .
Comments