OFFSET
1,2
COMMENTS
a(3320) has 1001 digits. - Michael S. Branicky, Feb 18 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..3319
FORMULA
a(n) = n*2^m + 2^m - 1 where m = n - A000120(n). - Michael S. Branicky, Feb 18 2023
EXAMPLE
6 represented in binary is 110. 111 (decimal) represented in binary is 1101111, which contains exactly six 1's and 110 as a substring ({110}1111). Since 111 is the smallest positive integer that satisfies the conditions, then a(6) = 111.
PROG
(Python)
def a(n): b = bin(n)[2:]; m = n - b.count("1"); return (n<<m) + (1<<m) - 1
print([a(n) for n in range(1, 33)]) # Michael S. Branicky, Feb 18 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Nov 11 2008
EXTENSIONS
Extended by Ray Chandler, Nov 15 2008
a(31) and beyond from Michael S. Branicky, Feb 18 2023
STATUS
approved