login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A300623
Let b(1) = 1; for n >= 2, b(n) = n - b(t(n)) - b(n-t(n-1)) where t = A302128. a(n) = 2*b(n) - n.
1
1, -2, 1, 0, 1, -2, -1, -2, 1, 2, -1, 0, 1, 0, 1, -2, -1, 2, 3, 2, 1, -2, -1, -4, -3, 2, 3, 0, 1, -4, -3, -4, -3, -2, 1, 2, -1, 0, 5, 6, 3, 4, -5, -4, -7, -6, -3, -2, -3, 2, 3, 2, 3, 2, 1, 0, 1, -2, -1, 4, 5, 2, 3, -8, -7, -10, -9, -4, -3, -6, -5, 8, 9, 6, 7, 10, 11, 10, 5, 6, 5, 6, -1, 0, -1, 0, -1, 0, 1, -2, -1, -4, -3
OFFSET
1,2
COMMENTS
Sequence has a fractal-like structure. Fibonacci numbers (A000045) are determinative for the generational boundaries.
MAPLE
t:= proc(n) option remember; `if`(n<4, 1,
t(t(n-2)) +t(n-t(n-1)))
end:
b:= proc(n) option remember; `if`(n<2, 1,
n -b(t(n)) -b(n-t(n-1)))
end:
seq(2*b(n)-n, n=1..100); # after Alois P. Heinz at A317686
MATHEMATICA
t[1]=t[2]=t[3]=1; t[n_] := t[n] = t[t[n-2]] + t[n - t[n-1]]; b[1]=1; b[n_] := b[n] = n - b[t[n]] - b[n - t[n-1]]; a[n_] := 2*b[n] - n; Array[a, 95] (* after Giovanni Resta at A317854 *)
PROG
(PARI) t=vector(99); t[1]=t[2]=t[3]=1; for(n=4, #t, t[n] = t[n-t[n-1]]+t[t[n-2]]); b=vector(99); b[1]=1; for(n=2, #b, b[n] = n-b[t[n]]-b[n-t[n-1]]); vector(99, k, 2*b[k]-k)
CROSSREFS
Sequence in context: A038698 A333590 A263233 * A087991 A335451 A366078
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 14 2018
STATUS
approved