Search: a323355 -id:a323355
|
|
A260956
|
|
a(0)=1; a(n) = Sum_{k=1..n-1} d(k)*a(n-k), where d(m) is m-th bit in binary expansion of n.
|
|
+10
2
|
|
|
1, 1, 1, 2, 2, 3, 5, 10, 10, 13, 23, 43, 66, 122, 231, 462, 462, 528, 759, 1452, 1980, 3201, 5412, 9603, 15015, 26598, 47025, 88638, 162261, 312939, 610863, 1221726, 1221726, 1310364, 1623303, 2547105, 3768831, 6300921, 9234588, 14715360, 21016281, 32797974
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
MAPLE
|
a:= proc(n) option remember; `if`(n=0, 1, (l-> add(
a(n-i)*l[-i], i=1..nops(l)))(convert(n, base, 2)))
end:
|
|
MATHEMATICA
|
a[0] = 1; a[n_] := a[n] = Total[(d = IntegerDigits[n, 2]) * Table[a[n - k], {k, 1, Length[d]}]]; Array[a, 50, 0] (* Amiram Eldar, Jul 25 2023 *)
|
|
PROG
|
(PARI) first(m)=my(v=vector(m)); v[1]=1; v[2]=1; for(i=3, m, v[i]=0; d=digits(i, 2); for(j=1, #d, v[i]+=d[j]*v[i-j])); v
(PARI) lista(nn) = {my(va = vector(nn), vb); va[1] = 1; for (n=2, nn, vb = binary(n); va[n] = sum(k=1, #vb, vb[k]*(if (n==k, 1, va[n-k]))); ); concat(1, va); } \\ Michel Marcus, Jan 12 2019
|
|
CROSSREFS
|
Cf. A033639 (when binary digits are taken in the reverse order).
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.035 seconds
|