OFFSET
1,2
LINKS
John Mason, Table of n, a(n) for n = 1..1000
FORMULA
For n>1, a(n) = n^2 iff n is prime.
a(n) = A007434(n) + A001065(n). - Conjectured by John Mason and proved by Max Alekseyev, Jan 07 2015
EXAMPLE
a(4) = 15 = sum of row 4 terms of triangle A134674: (4, + 3 + 4 + 4).
MATHEMATICA
f1[p_, e_] := p^(2*e) - p^(2*e-2); f2[p_, e_] := (p^(e+1)-1)/(p-1); a[1] = 1; a[n_] := Times @@ f1 @@@ (f = FactorInteger[n]) + Times @@ f2 @@@ f - n; Array[a, 60] (* Amiram Eldar, Aug 22 2023 *)
PROG
(PARI) a(n) = sumdiv(n, d, d^2*moebius(n/d)+d)-n /* Max Alekseyev, Jan 07 2015 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Nov 05 2007
EXTENSIONS
More terms from John Mason, Jan 07 2015
STATUS
approved