OFFSET
1,5
COMMENTS
b(n) = A109812(n) is the least k that does not appear in b(1..n-1) that avoids the ON bits in b(n-1).
a(n) is the decimal value of available bits "unused" in k.
If b(n) = 2^m - 1, then a(n) = 0 iff b(n) = 2^m.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log-log scatterplot of a(n) for n = 1..2^16, substituting 1/2 for 0 so as to plot in blue, records labelled in red, fixed points shown in amber.
Michael De Vlieger, Bitmap of a(n) for n = 1..2^10, where each term is shown vertically, with least significant bit at bottom, 12X vertical exaggeration. Black corresponds to 1 and white to 0.
Michael De Vlieger, Bitmap of a(n) for n = 1..2^14, where each term is shown horizontally, with least significant bit at right, 256X horizontal exaggeration. Black corresponds to 1 and white to 0.
Rémy Sigrist, PARI program
FORMULA
a(n) = 2^(1 + max(floor(log_2 i), floor(log_2 j))) - (i + j) - 1, with i = A109812(n-1) and j = A109812(n). - Michael De Vlieger, Apr 05 2022
EXAMPLE
Relation between a(n) and b(n) = A109812(n). The binary expansion of b(n) = b(n)_2 = A352575(n), showing zeros as "." to accentuate 1 bits:
n b(n)_2 b(n) a(n)
----------------------
1 1 1 1
2 1. 2 0
3 1.. 4 1
4 11 3 0
5 1... 8 4
6 1.1 5 2
7 1.1. 10 0
8 1.... 16 5
9 11. 6 9
10 1..1 9 0
11 1..1. 18 4
12 11.. 12 1
13 1...1 17 2
14 111. 14 0
15 1..... 32 17
16 111 7 24
...
MATHEMATICA
c[_] = 0; a[1] = c[1] = 1; u = 2; {1}~Join~Reap[Do[k = u; While[Nand[c[k] == 0, BitAnd[a[i - 1], k] == 0], k++]; Set[{a[i], c[k]}, {k, i}]; Sow[FromDigits[IntegerDigits[BitOr[a[i - 1], a[i]], 2] /. {0 -> 1, 1 -> 0}, 2]]; If[k == u, While[c[u] > 0, u++]], {i, 2, 77}]][[-1, -1]]
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Michael De Vlieger, Apr 01 2022
STATUS
approved