login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A318056 Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n-1)) where t = A004001. a(n) = 2*b(n) - n. 2
1, 0, -1, 0, 1, 0, 1, 0, -3, -2, -3, -2, -1, 0, -1, 0, 5, 4, 5, 4, 5, 2, 1, 2, 3, 4, 3, 0, 1, 0, 1, 0, -11, -10, -11, -10, -11, -10, -7, -6, -7, -6, -9, -10, -9, -8, -7, -8, -3, -4, -3, -2, -1, -2, -5, -4, -5, -4, -1, 0, -1, 0, -1, 0, 21, 20, 21, 20, 21, 20, 21, 16, 15, 16, 15, 16, 19, 20, 19, 20 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
LINKS
MAPLE
t:= proc(n) option remember; `if`(n<3, 1,
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-1)))
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] = 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-1]]; a[n_] := 2*b[n] - n; Array[a, 95] (* after Giovanni Resta at A317854 *)
PROG
(PARI) t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[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-1]]); vector(99, k, 2*b[k]-k)
CROSSREFS
Sequence in context: A220344 A176102 A344220 * A096839 A099891 A241173
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 14 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 20:26 EDT 2024. Contains 371781 sequences. (Running on oeis4.)