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.

Showing 1-8 of 8 results.

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Altug Alkan, Aug 06 2018

Keywords

Crossrefs

Programs

  • 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 *)
  • 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)

A317648 a(1) = a(2) = 1; for n >= 3, a(n) = a(t(n)) + a(n-t(n)) where t = A004001.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 12, 12, 13, 14, 15, 15, 15, 15, 16, 16, 17, 17, 18, 19, 20, 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 27, 27, 27, 27, 27, 27, 28, 29, 30, 31, 31, 31, 31, 31, 32, 32, 33, 33, 34, 35, 36, 37, 38, 38, 38, 38, 38, 38, 39, 40, 41, 42, 43, 44, 45
Offset: 1

Views

Author

Altug Alkan, Aug 02 2018

Keywords

Comments

This sequence hits every positive integer.
Let b(1) = b(2) = b(3) = 1; for n >= 4, b(n) = b(t(n)) + b(n-t(n)) where t = A004001. Observe the symmetric relation between this sequence (a(n)) and b(n) thanks to line plots of a(n)-n/2 and b(n)-n/2 in Links section.

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<3, 1,
          b(b(n-1)) +b(n-b(n-1)))
        end:
    a:= proc(n) option remember; `if`(n<3, 1,
          a(b(n)) +a(n-b(n)))
        end:
    seq(a(n), n=1..100); # after Alois P. Heinz at A317686
  • Mathematica
    t[1] = 1; t[2] = 1; t[n_] := t[n] = t[t[n-1]] + t[n - t[n-1]];
    a[1] = a[2] = 1; a[n_] := a[n] = a[t[n]] + a[n - t[n]];
    Array[a, 100] (* Jean-François Alcover, Nov 01 2020 *)
  • PARI
    t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = t[t[n-1]]+t[n-t[n-1]]); a=vector(99); a[1]=a[2]=1; for(n=3, #a, a[n] = a[t[n]]+a[n-t[n]]); a

Formula

a(n+1) - a(n) = 0 or 1 for all n >= 1.

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.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Aug 09 2018

Keywords

Comments

A different version of A317742. Similar to A317754.

Crossrefs

Programs

  • 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 *)
  • 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.

Formula

abs(a(n)) = A317742(n).

A317742 Let b(1) = b(2) = 1; for n >= 3, b(n) = b(t(n)) + b(n-t(n)) where t = A287422. a(n) = 2*b(n) - n.

Original entry on oeis.org

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, 6, 5, 4, 3, 4, 5, 6, 7, 8, 9, 10
Offset: 1

Views

Author

Altug Alkan, Aug 05 2018

Keywords

Comments

This sequence has fractal-like structure as A004074, although there are substantial differences of this sequence based on slow A287422 and b(n) sequences. See plots of this sequence and A004074 in Links section.

Crossrefs

Programs

  • 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,
          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, n - a[[a[[-1]] ]] - a[[-a[[-1]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, Last@ # < 10^2 &], b}, b = NestWhile[Function[{b, n}, Append[b, b[[t[[n]] ]] + b[[-t[[n]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, Last@ # < Max@ t &]; Array[2 b[[#]] - # &, Length@ b] ] (* Michael De Vlieger, Aug 07 2018 *)
    t[n_] := t[n] = If[n<3, 1, n - t[t[n-1]] - t[n - t[n-1]]]; b[n_] := b[n] = If[n<3, 1, b[t[n]] + b[n - t[n]]]; Table[2*b[n] - n, {n, 106}] (* Giovanni Resta, Aug 14 2018 *)
  • PARI
    t=vector(199); t[1]=t[2]=1; for(n=3, #t, t[n] = n-t[n-t[n-1]]-t[t[n-1]]); b=vector(199); b[1]=b[2]=1; for(n=3, #b, b[n] = b[t[n]]+b[n-t[n]]); vector(199, k, 2*b[k]-k)

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Altug Alkan, Aug 14 2018

Keywords

Crossrefs

Programs

  • 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 *)
  • 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)

A319020 Let b_i(k) = 1 for k <= i; for n > i, b_i(n) = b_i(t(n)) + b_i(n-t(n)) where t = A063882. a(n) = 3*b_2(n)-2*n if n is even, a(n) = 3*b_4(n)-n if n is odd.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Sep 08 2018

Keywords

Crossrefs

Programs

  • PARI
    t=f=g=vector(200); t[1]=t[2]=t[3]=t[4]=1; for(n=5, #t, t[n] = t[n-t[n-1]]+t[n-t[n-4]]); f[1]=f[2]=1; for(n=3, #f, f[n] = f[t[n]]+f[n-t[n]]); g[1]=g[2]=g[3]=g[4]=1; for(n=5, #g, g[n] = g[t[n]]+g[n-t[n]]); vector(200, n, if(n%2==0, 3*f[n]-2*n,3*g[n]-n))

A300623 Let b(1) = 1; for n >= 2, b(n) = n - b(t(n)) - b(n-t(n-1)) where t = A302128. a(n) = 2*b(n) - n.

Original entry on oeis.org

1, -2, 1, 0, 1, -2, -1, -2, 1, 2, -1, 0, 1, 0, 1, -2, -1, 2, 3, 2, 1, -2, -1, -4, -3, 2, 3, 0, 1, -4, -3, -4, -3, -2, 1, 2, -1, 0, 5, 6, 3, 4, -5, -4, -7, -6, -3, -2, -3, 2, 3, 2, 3, 2, 1, 0, 1, -2, -1, 4, 5, 2, 3, -8, -7, -10, -9, -4, -3, -6, -5, 8, 9, 6, 7, 10, 11, 10, 5, 6, 5, 6, -1, 0, -1, 0, -1, 0, 1, -2, -1, -4, -3
Offset: 1

Views

Author

Altug Alkan, Aug 14 2018

Keywords

Comments

Sequence has a fractal-like structure. Fibonacci numbers (A000045) are determinative for the generational boundaries.

Crossrefs

Programs

  • Maple
    t:= proc(n) option remember; `if`(n<4, 1,
          t(t(n-2)) +t(n-t(n-1)))
        end:
    b:= proc(n) option remember; `if`(n<2, 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]=t[3]=1; t[n_] := t[n] = t[t[n-2]] + t[n - t[n-1]]; b[1]=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 *)
  • PARI
    t=vector(99); t[1]=t[2]=t[3]=1; for(n=4, #t, t[n] = t[n-t[n-1]]+t[t[n-2]]); b=vector(99); b[1]=1; for(n=2, #b, b[n] = n-b[t[n]]-b[n-t[n-1]]); vector(99,k, 2*b[k]-k)

A309430 a(n) = a(n-a(n-1)) + a(n-a(n-4)), with a(n) = ceiling(2*n/3) for n <= 7.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 26, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 31, 32, 33, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 41, 41, 41, 42, 42, 43, 44, 44
Offset: 1

Views

Author

Altug Alkan, Aug 01 2019

Keywords

Comments

A slow solution to Hofstadter V recurrence.
Numbers k such that a(k) < A063882(k) are 1654, 1721, 1925, ...

Crossrefs

Programs

  • PARI
    q=vector(100); for(n=1, 7, q[n]=ceil(2*n/3));for(n=8, #q, q[n]=q[n-q[n-1]] +q[n-q[n-4]]); q

Formula

a(n+1) - a(n) = 0 or 1 for all n >= 1.
Showing 1-8 of 8 results.