login
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
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:
seq(a(n), n=0..80); # Alois P. Heinz, Feb 28 2022
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
Sequence in context: A290422 A352402 A278954 * A331884 A146430 A146281
KEYWORD
base,nonn
AUTHOR
Rémy Sigrist, Feb 25 2022
STATUS
approved