OFFSET
1,6
LINKS
FORMULA
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
PROG
(PARI)
A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
(Python)
from functools import reduce
from sympy import factorint
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 29 2018
STATUS
approved