A372470 Multiplicative with a(p^e) = e+1 if e+1 is a power of 2, and 0 otherwise.
1, 2, 2, 0, 2, 4, 2, 4, 0, 4, 2, 0, 2, 4, 4, 0, 2, 0, 2, 0, 4, 4, 2, 8, 0, 4, 4, 0, 2, 8, 2, 0, 4, 4, 4, 0, 2, 4, 4, 8, 2, 8, 2, 0, 0, 4, 2, 0, 0, 0, 4, 0, 2, 8, 4, 8, 4, 4, 2, 0, 2, 4, 0, 0, 4, 8, 2, 0, 4, 8, 2, 0, 2, 4, 0, 0, 4, 8, 2, 0, 0, 4, 2, 0, 4, 4, 4
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[p_, e_] := If[e + 1 == 2^IntegerExponent[e + 1, 2], e + 1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
-
PARI
a(n) = vecprod(apply(x -> if(x+1 == 1 << valuation(x+1, 2), x+1, 0), factor(n)[, 2]));