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-4 of 4 results.

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

Original entry on oeis.org

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

Views

Author

Altug Alkan, Aug 04 2018

Keywords

Comments

This sequence hits every positive integer and it has a fractal-like structure, see scatterplot of 2*n-3*a(n) in Links section.
Let b(1) = b(2) = b(3) = b(4) = 1; for n >= 5, b(n) = b(t(n)) + b(n-t(n)) where t = A063882. Observe the symmetric relation between this sequence (a(n)) and b(n) thanks to plots of a(n)-2*n/3 and b(n)-n/3 in Links section. Note that a(n) + b(n) = n for n >= 2.

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<5, 1,
          b(n-b(n-1)) +b(n-b(n-4)))
        end:
    a:= proc(n) option remember; `if`(n<3, 1,
          a(b(n)) +a(n-b(n)))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 05 2018
  • Mathematica
    b[n_] := b[n] = If[n < 5, 1, b[n - b[n - 1]] + b[n - b[n - 4]]];
    a[n_] := a[n] = If[n < 3, 1, a[b[n]] + a[n - b[n]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Mar 02 2022, after Alois P. Heinz *)
  • PARI
    t=vector(99); 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]]); 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.

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)

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)

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

Original entry on oeis.org

1, 1, 2, 2, 5, 5, 4, 4, 13, 13, 10, 7, 7, 7, 8, 8, 35, 35, 26, 17, 8, 8, 8, 8, 11, 14, 17, 17, 17, 17, 16, 16, 97, 97, 70, 43, 16, -11, -11, -11, -11, -11, -2, 7, 16, 25, 34, 43, 43, 43, 43, 43, 43, 43, 40, 37, 34, 31, 31, 31, 31, 31, 32, 32, 275, 275, 194, 113, 32, -49, -130, -130, -130, -130, -130
Offset: 1

Views

Author

Altug Alkan, Aug 11 2018

Keywords

Comments

Sequence has a fractal-like structure. Each generation (between consecutive powers of 2) provides a pattern which looks like an EKG signal since maximum value of a(n) (in corresponding generation) is damped step by step.

Crossrefs

Programs

  • PARI
    t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = t[n-t[n-1]]+t[t[n-1]]); a=vector(99); a[1]=a[2]=1; for(n=3, #a, a[n] = 3*a[t[n]]-a[n-t[n]]); a
Showing 1-4 of 4 results.