[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login
A364871
a(n) = B(n) - A(n), where A(1) = 0, B(1) = 1, and sequences A and B are the lexicographically earliest sequences that start with their respective first terms and contain no term whose binary expansion is the concatenation of any two earlier terms in that sequence.
3
1, 1, 0, 0, 3, -4, -2, -1, -1, 4, 3, 4, 8, 8, 11, 11, 11, 1, 2, -2, -1, -11, -11, -12, -12, -7, -8, -5, -1, -2, -2, 2, -2, 0, 0, 1, 3, 6, 9, 9, 14, 10, 12, 13, 15, 19, 21, 22, 22, 25, 25, 20, 17, 11, 13, 8, 10, 6, 6, 1, 0, 4, 4, 4, 9, 8, 8, 1, 1, 1, 1, -6, -12, -11, -15, -21, -18, -20
OFFSET
1,5
COMMENTS
Empirical observation: the graph looks like hills in a repeating fractal-like pattern; each peak is about 1.4 times as high as the previous one.
FORMULA
a(n) = A365018(n) - A365017(n).
EXAMPLE
Sequence A: 0, 1, 3, 4, 5, 14, 15, 16, 17, 18, 20, 21, 22, ...
Sequence B: 1, 2, 3, 4, 8, 10, 13, 15, 16, 22, 23, 25, 30, ...
{a(n)}: 1, 1, 0, 0, 3, -4, -2, -1, -1, 4, 3, 4, 8, ...
MATHEMATICA
conc[x_, y_] := FromDigits[Flatten@IntegerDigits[{x, y}, 2], 2]; f[n_, m_] := f[n, m] = If[n == 1, m, Module[{k = f[n - 1, m] + 1, v = Array[f[#, m] &, n - 1], c}, c = conc @@@ Select[Tuples[v, {2}], UnsameQ @@ # &]; While[! FreeQ[c, k], k++]; k]]; a[n_] := f[n, 1] - f[n, 0]; Array[a, 80] (* Amiram Eldar, Sep 29 2023 *)
PROG
(Python)
from itertools import islice
def g(s=0): # helper generator for sequences A (s=0) and B (s=1)
cn, bins, concats = s, {bin(s)[2:]}, set()
while True:
yield cn
while (bn:=bin(cn:=cn+1)[2:]) in concats: pass
concats |= {bn+bi for bi in bins} | {bi+bn for bi in bins}
bins.add(bn)
def agen(): # generator of terms
A, B = g(s=0), g(s=1)
yield from (Bn - An for An, Bn in zip(A, B))
print(list(islice(agen(), 78))) # Michael S. Branicky, Nov 01 2023
CROSSREFS
Sequence in context: A200125 A091528 A236679 * A096392 A332964 A105825
KEYWORD
sign,base,look
AUTHOR
Attila Kiss, Aug 11 2023
STATUS
approved