A355621 a(1) = 1; for n > 1, a(n) is the number of terms in the first n-1 terms of the sequence that share a 1-bit with a(n-1) in their binary expansions.
1, 1, 2, 1, 3, 5, 5, 6, 5, 8, 1, 8, 2, 4, 5, 11, 15, 17, 12, 11, 19, 17, 15, 23, 22, 19, 22, 21, 24, 16, 10, 18, 20, 21, 29, 33, 22, 30, 33, 23, 38, 31, 42, 28, 35, 37, 38, 37, 40, 22, 41, 40, 24, 33, 35, 46, 49, 49, 50, 47, 59, 60, 55, 61, 62, 61, 64, 1, 39, 63, 69, 58, 60, 64, 3, 60, 65, 46, 67
Offset: 1
Examples
a(7) = 5 as a(6) = 5 and the total number of terms in the first six terms that share a 1-bit with 5 in their binary expansions is five, namely 1, 1, 1, 3, 5.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
- Scott R. Shannon, Image of the first 500000 terms. The green line is y = n.
Programs
-
Python
from itertools import count, islice def agen(): an, alst = 1, [1] for n in count(2): yield an an = sum(1 for k in alst if k&an) alst.append(an) print(list(islice(agen(), 79))) # Michael S. Branicky, Jul 10 2022
Comments