cp's OEIS Frontend

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.

A317161 Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n)) where t = A005185. a(n) = 2*b(n) - n.

Original entry on oeis.org

1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, -1, 0, -1, 0, 1, 2, 1, 0, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -1, 0, 1, -2, -1, 0, -1, -2, -3, -2, -1, 0, 1, 0, -1, 0, -1, -2, 1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 1, 0, -1, 0, -1, 0, 1, 2, 1, 0, 3, 0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 0, 3, 2, 3, 4, 1, 2, 1, 0, -1, 0, 1, 0, 3, 0, -1
Offset: 1

Views

Author

Altug Alkan, Aug 07 2018

Keywords

Comments

If there is a limiting value l such that lim_{n->infinity} b(n)/n = lim_{n->infinity} t(n)/n = l, then l = 1/2. So this sequence has definition a(n) = 2*b(n) - n.

Crossrefs

Programs

  • Mathematica
    Block[{t = NestWhile[Function[{a, n}, Append[a, a[[n - a[[-1]] ]] + a[[n - a[[-2]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, Last@ # < 65 &], b}, b = NestWhile[Function[{b, n}, Append[b, n - b[[t[[n]] ]] - b[[n - t[[n]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, Length@ # < Length@ t &]; Array[2 b[[#]] - # &, Length@ b] ] (* Michael De Vlieger, Aug 08 2018 *)
  • PARI
    t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = t[n-t[n-1]]+t[n-t[n-2]]); 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)