login
A317854
Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n)) where t = A287422. a(n) = 2*b(n) - n.
4
1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, -2, -1, 0, -1, 0, 1, 0, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 0, 1, 0, -1, 0, -1, -2, -3, -4, -3, -2, -1, -2, -3, -2, -3, -4, -5, -6, -5, -4, -3, -2, -3, -2, -1, -2, -3, -4, -3, -2, -1, 0, -1, 0, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 4, 5
OFFSET
1,12
COMMENTS
A different version of A317742. Similar to A317754.
FORMULA
abs(a(n)) = A317742(n).
MAPLE
t:= proc(n) option remember; `if`(n<3, 1,
n -t(t(n-1)) -t(n-t(n-1)))
end:
b:= proc(n) option remember; `if`(n<3, 1,
n -b(t(n)) -b(n-t(n)))
end:
seq(2*b(n)-n, n=1..100); # after Alois P. Heinz at A317686
MATHEMATICA
t[1]=t[2]=1; t[n_] := t[n] = n - t[t[n-1]] - t[n - t[n-1]]; b[1]=b[2]=1; b[n_] := b[n] = n - b[t[n]] - b[n - t[n]]; a[n_] := 2*b[n] - n; Array[a, 95] (* Giovanni Resta, Aug 14 2018 *)
PROG
(PARI) t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = n-t[n-t[n-1]]-t[t[n-1]]); b=vector(99); b[1]=b[2]=1; for(n=3, #b, b[n] = n-b[t[n]]-b[n-t[n]]); vector(99, k, 2*b[k]-k)
(C++) See Links section.
CROSSREFS
KEYWORD
sign,look,hear
AUTHOR
Altug Alkan, Aug 09 2018
STATUS
approved