Skip to content

Commit eb566a7

Browse files
committed
add reference to sequence A002822
1 parent cd20254 commit eb566a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/dubner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
# consider multiples of 6.
4040
middles = twins[2::3] >> 1
4141

42+
# The indices of 1 bits give sequence https://oeis.org/A002822
43+
lst = list(middles.search(1, 0, 46))
44+
assert lst == [1, 2, 3, 5, 7, 10, 12, 17, 18, 23, 25, 30, 32, 33, 38, 40, 45]
45+
4246
# m is a middle number when middles[m//6].
4347
# The first middle numbers greater than 4 are:
4448
lst = [6 * i for i in middles.search(1, 0, 20)]

0 commit comments

Comments
 (0)