OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Andrew Howroyd)
Steven R. Finch, Idempotents and Nilpotents Modulo n, arXiv:math/0605019 [math.NT], 2006-2017.
FORMULA
Multiplicative with a(p^e) = p^floor(e/2) + (p-1)*p^(e-1) for prime p. - Andrew Howroyd, Jul 17 2018
Sum_{k=1..n} a(k) ~ c*n^2, where c = (1/2) * Product_{p prime} (1 - 1/(p^2*(p^2 + p + 1))) = 0.47717662698737204270... - Amiram Eldar, Sep 08 2020
MATHEMATICA
a[n_] := Product[{p, e} = pe; p^Quotient[e, 2] + (p-1)*p^(e-1), {pe, FactorInteger[n]}]; Array[a, 72] (* Jean-François Alcover, Sep 13 2018, after Andrew Howroyd *)
PROG
(PARI) a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i, 1], e=f[i, 2]); p^(e\2) + (p-1)*p^(e-1))} \\ Andrew Howroyd, Jul 17 2018
CROSSREFS
KEYWORD
mult,nonn
AUTHOR
Steven Finch, Apr 11 2006
STATUS
approved