A023691 Numbers with exactly 9 ones in binary expansion.
511, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1279, 1407, 1471, 1503, 1519, 1527, 1531, 1533, 1534, 1663, 1727, 1759, 1775, 1783, 1787, 1789, 1790, 1855, 1887, 1903, 1911, 1915, 1917, 1918, 1951, 1967, 1975
Offset: 1
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
- Robert Baillie, Summing the curious series of Kempner and Irwin, arXiv:0806.4410 [math.CA], 2008-2015. See p. 18 for Mathematica code irwinSums.m.
Crossrefs
Programs
-
Mathematica
Select[ Range[ 511, 2048 ], (Count[ IntegerDigits[ #, 2 ], 1 ]==9)& ]
-
PARI
is_A023691(n)=hammingweight(n)==9 \\ M. F. Hasler, Aug 27 2014
-
PARI
print1(t=2^9-1); for(i=2, 50, print1(", "t=A057168(t))) \\ M. F. Hasler, Aug 27 2014
-
Python
from itertools import islice def A023691_gen(): # generator of terms yield (n:=511) while True: yield (n:=((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b) A023691_list = list(islice(A023691_gen(),30)) # Chai Wah Wu, Mar 06 2025
Formula
a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
Sum_{n>=1} 1/a(n) = 1.386348105265697723853732153017686670695581836109569165990080192653647019078... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022