OFFSET
1,4
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2^A370078(n).
a(n) = 1 if and only if n is an exponentially odd number (A268335).
Multiplicative with a(p^e) = e if e is a power of 2, and 1 otherwise.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Product_{p prime} (1 + Sum_{k>=1} (2^k-1)*(1/p^(2^k) - 1/p^(2^k+1))) = 1.47219167074464124662... .
MATHEMATICA
f[p_, e_] := If[e == 2^IntegerExponent[e, 2], e, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(PARI) ispow2(n) = n >> valuation(n, 2) == 1;
a(n) = vecprod(apply(x -> if(ispow2(x), x, 1), factor(n)[, 2]));
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Amiram Eldar, Feb 09 2024
STATUS
approved