%I #15 Feb 11 2024 02:41:42
%S 0,1,1,1,1,2,1,2,1,2,1,2,1,2,2,1,1,2,1,2,2,2,1,3,1,2,2,2,1,3,1,3,2,2,
%T 2,2,1,2,2,3,1,3,1,2,2,2,1,2,1,2,2,2,1,3,2,3,2,2,1,3,1,2,2,2,2,3,1,2,
%U 2,3,1,3,1,2,2,2,2,3,1,2,1,2,1,3,2,2,2,3,1,3,2,2,2,2,2,4,1,2,2,2,1,3,1,3,3
%N Additive with a(p^e) = A002487(e).
%H Antti Karttunen, <a href="/A318306/b318306.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.
%F a(n) = A007814(A318307(n)).
%F Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761) and C = Sum_{p prime} f(1/p) = 0.15790080909728804399..., where f(x) = -x + x * (1-x) * Product{k>=0} (1 + x^(2^k) + x^(2^(k + 1))). - _Amiram Eldar_, Feb 11 2024
%o (PARI)
%o A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
%o A318306(n) = vecsum(apply(e -> A002487(e),factor(n)[,2]));
%o (Python)
%o from functools import reduce
%o from sympy import factorint
%o def A318306(n): return sum(sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(e)[-1:2:-1],(1,0))) for e in factorint(n).values()) # _Chai Wah Wu_, May 18 2023
%Y Cf. A002487, A077761, A318307.
%Y Cf. also A046644.
%K nonn
%O 1,6
%A _Antti Karttunen_, Aug 29 2018
|