This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A317754 #18 Aug 09 2018 13:21:50 %S A317754 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, %T A317754 0,-1,0,-1,-2,-3,-4,-3,-2,-1,0,-1,-2,-3,-4,-5,-6,-5,-4,-3,-2,-1,0,-1, %U A317754 -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 %N 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. %H A317754 Altug Alkan, <a href="/A317754/b317754.txt">Table of n, a(n) for n = 1..32768</a> %p A317754 t:= proc(n) option remember; `if`(n<3, 1, %p A317754 t(t(n-1)) +t(n-t(n-1))) %p A317754 end: %p A317754 b:= proc(n) option remember; `if`(n<3, 1, %p A317754 n -b(t(n)) -b(n-t(n))) %p A317754 end: %p A317754 seq(2*b(n)-n, n=1..100); # after _Alois P. Heinz_ at A317686 %t A317754 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 *) %o A317754 (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) %Y A317754 Cf. A004001, A004074, A317648, A317742. %K A317754 sign,look,hear %O A317754 1,12 %A A317754 _Altug Alkan_, Aug 06 2018