|
0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 3, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 3, 3, 1, 3, 1, 4, 2, 2, 2, 4, 1, 2, 2, 4, 1, 3, 1, 3, 3, 2, 1, 4, 2, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 4, 1, 2, 3, 5, 2, 3, 1, 3, 2, 3, 1, 5, 1, 2, 3, 3, 2, 3, 1, 4, 3, 2, 1, 4, 2, 2, 2, 4, 1, 4, 2, 3, 2, 2, 2, 5, 1, 3, 3, 4, 1, 3, 1, 4, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
FORMULA
|
|
|
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 A318322(n): return sum(sum(reduce(lambda x, y:(x[0], sum(x)) if int(y) else (sum(x), x[1]), bin((e<<1)-1)[-1:2:-1], (1, 0))) for e in factorint(n).values()) # Chai Wah Wu, May 18 2023
|
|
CROSSREFS
|
Differs from A122810 for the first time at n=48, where a(48) = 4, while A122810(48) = 5.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|