OFFSET
1,4
LINKS
FORMULA
Multiplicative with a(p^e) = f(p, e) if e is even, and f(p, e) - p is e is odd, where f(p, e) = Product{k>=1, e_k=1} (p^(2^k) + 1), where e = Sum_{k} e_k * 2^k is the binary representation of e, i.e., e_k is bit k of e.
a(n) <= A049417(n), with equality if and only if n is a square.
MATHEMATICA
f[p_, e_] := Times @@ (p^(2^(-1 + Flatten @ Position[Reverse@IntegerDigits[e, 2], _?(# == 1 &)])) + 1) - If[OddQ[e], p, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(PARI) a(n) = {my(f = factor(n), b); prod(i=1, #f~, b = binary(f[i, 2]); prod(k=1, #b, if(b[k], f[i, 1]^(2^(#b-k))+1, 1)) - if(f[i, 2]%2, f[i, 1], 0)); }
CROSSREFS
KEYWORD
nonn,mult,easy
AUTHOR
Amiram Eldar, Feb 18 2023
STATUS
approved