OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) is multiplicative with a(2) = 0, a(2^e) = 2 if e>1, a(p^e) = e+1 if p == 1, 3 (mod 8), a(p^e) = (1+(-1)^e)/2 if p == 5, 7 (mod 8).
a(4*n + 2) = a(8*n + 5) = a(8*n + 7) = 0. a(4*n) = 2 * A002325(n). a(8*n + 1) = A112603(n). a(8*n + 3) = A033761(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/(2*sqrt(2)) = 1.110720... (A093954). - Amiram Eldar, Oct 13 2022
MATHEMATICA
f[p_, e_] := If[MemberQ[{1, 3}, Mod[p, 8]], e + 1, (1 + (-1)^e)/2]; f[2, e_] := If[e > 1, 2, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 13 2022 *)
PROG
(PARI) {a(n) = if( n<1, 0, qfrep([1, 0; 0, 8], n)[n] + qfrep([3, 1; 1, 3], n)[n])}
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Michael Somos, Nov 20 2006
STATUS
approved