|
|
A350802
|
|
a(n) is the sum of the numbers k < n such that a(k) AND n = a(k) (where AND denotes the bitwise AND operator).
|
|
3
|
|
|
0, 0, 1, 3, 1, 7, 1, 21, 1, 21, 1, 34, 1, 43, 1, 65, 1, 73, 1, 94, 1, 127, 1, 157, 1, 157, 1, 186, 1, 227, 1, 265, 1, 273, 12, 287, 1, 309, 12, 328, 1, 349, 12, 376, 115, 463, 126, 495, 1, 397, 12, 411, 1, 465, 12, 484, 1, 505, 12, 532, 277, 797, 288, 829, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
The definition is recursive: a(n) depends on prior terms (a(0), ..., a(n-1)); a(0) = a(1) = 0 correspond to empty sums.
|
|
LINKS
|
|
|
EXAMPLE
|
The first terms, alongside the corresponding k's, are:
n a(n) k's
-- ---- -------------------------
0 0 {}
1 0 {0}
2 1 {0, 1}
3 3 {0, 1, 2}
4 1 {0, 1}
5 7 {0, 1, 2, 4}
6 1 {0, 1}
7 21 {0, 1, 2, 3, 4, 5, 6}
8 1 {0, 1}
9 21 {0, 1, 2, 4, 6, 8}
10 1 {0, 1}
11 34 {0, 1, 2, 3, 4, 6, 8, 10}
12 1 {0, 1}
|
|
MAPLE
|
a:= proc(n) option remember; add(
`if`(Bits[And](n, a(j))=a(j), j, 0), j=0..n-1)
end:
|
|
PROG
|
(PARI) for (n=1, #a=vector(65), print1 (a[n]=sum(k=1, n-1, if (bitand(a[k], n-1)==a[k], k-1, 0))", "))
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|