OFFSET
1,4
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
Multiplicative with a(p^e) = Product_{k >= 0, 2^k < e, bitand(e, 2^k) = 0} (p^(2^k) + 1).
a(n) >= 1, with equality if and only if n is in A036537.
a(n) <= n-1, with equality if and only if n = 2^(2^k) for k >= 0.
MATHEMATICA
f[p_, e_] := p^(2^(-1 + Position[Reverse@ IntegerDigits[e, 2], _?(# == 0 &)])); a[1] = 1; a[n_] := Times @@ (Flatten@ (f @@@ FactorInteger[n]) + 1); Array[a, 100]
PROG
(PARI) s(n) = apply(x -> 1 - x, binary(n));
a(n) = {my(f = factor(n), k); prod(i = 1, #f~, k = s(f[i, 2]); prod(j = 1, #k, if(k[j], f[i, 1]^(2^(#k-j)) + 1, 1))); }
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Amiram Eldar, May 10 2024
STATUS
approved