This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A317754 Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n)) where t = A004001. a(n) = 2*b(n) - n. 6
 1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, -2, -1, 0, -1, 0, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 0, -1, 0, -1, -2, -3, -4, -3, -2, -1, 0, -1, -2, -3, -4, -5, -6, -5, -4, -3, -2, -1, 0, -1, -2, -3, -4, -3, -2, -1, 0, -1, 0, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,12 LINKS Altug Alkan, Table of n, a(n) for n = 1..32768 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)))     end: seq(2*b(n)-n, n=1..100); # after Alois P. Heinz at A317686 MATHEMATICA Block[{t = NestWhile[Function[{a, n}, Append[a, a[[a[[-1]] ]] + a[[-a[[-1]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, Last@ # < 60 &], b}, b = NestWhile[Function[{b, n}, Append[b, n - b[[t[[n]] ]] - b[[-t[[n]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, Length@ # < Length@ t &]; Array[2 b[[#]] - # &, Length@ b] ] (* Michael De Vlieger, Aug 07 2018 *) 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]]); vector(99, k, 2*b[k]-k) CROSSREFS Cf. A004001, A004074, A317648, A317742. Sequence in context: A266874 A308343 A071993 * A317854 A317742 A118777 Adjacent sequences:  A317751 A317752 A317753 * A317755 A317756 A317757 KEYWORD sign,look,hear AUTHOR Altug Alkan, Aug 06 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 19 06:47 EDT 2019. Contains 324218 sequences. (Running on oeis4.)