OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Steven R. Finch, Idempotents and Nilpotents Modulo n, arXiv:math/0605019 [math.NT], 2006-2017.
FORMULA
Multiplicative with a(3) = 2, a(3^e) = 3^(e-1) + 3 for e > 1, and for p != 3, if p == 1 (mod 3), a(p^e) = p^(e-1) + 3, and if p == 2 (mod 3), a(p^e) = p^(e-1) + 1. - Amiram Eldar, Sep 08 2020
MATHEMATICA
f[3, e_] := If[e < 2, 2, 3^(e - 1) + 3]; f[p_, e_] := If[Mod[p, 3] == 1, p^(e - 1) + 3, p^(e - 1) + 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 08 2020 *)
CROSSREFS
KEYWORD
mult,nonn
AUTHOR
Steven Finch, Apr 11 2006
STATUS
approved