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.

Previous Showing 11-15 of 15 results.

A285578 a(1) = a(3) = a(4) = 2, a(2) = 1; a(n) = a(a(n-2)) + a(n-a(n-4)-2) for n > 4.

Original entry on oeis.org

2, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 24, 25, 27, 27, 28, 28, 28, 29, 29, 30, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 34, 35
Offset: 1

Views

Author

Altug Alkan, Apr 22 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = a[3] = a[4] = 2; a[2] = 1; a[n_] := a[n] = a[a[n - 2]] + a[n - a[n - 4] - 2]; Array[a, 75] (* Michael De Vlieger, Apr 24 2017 *)
  • PARI
    q=vector(10000); q[1]=q[3]=q[4]=2;q[2]=1; for(n=5, #q, q[n]=q[q[n-2]]+q[n-q[n-4]-2]); vector(10000, n, q[n])

A285582 a(1) = 1, a(2) = a(3) = a(4) = 2; a(n) = a(a(n-3)-1) + a(n-a(n-4)-1) for n > 4.

Original entry on oeis.org

1, 2, 2, 2, 3, 3, 3, 5, 5, 5, 5, 5, 5, 7, 7, 7, 8, 8, 8, 8, 8, 8, 10, 10, 10, 13, 12, 13, 13, 12, 13, 13, 13, 13, 13, 13, 15, 15, 15, 20, 17, 20, 20, 17, 20, 18, 20, 20, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 23, 23, 23, 28, 23, 28, 29, 23, 32, 28, 23, 31, 27, 28, 33, 33, 32
Offset: 1

Views

Author

Altug Alkan, Apr 22 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = a[3] = a[4] = 2; a[n_] := a[n] = a[a[n - 3] - 1] + a[n - a[n - 4] - 1]; Array[a, 75] (* Michael De Vlieger, Apr 23 2017 *)
  • PARI
    q=vector(10000); q[1]=1;q[2]=q[3]=q[4]=2; for(n=5, #q, q[n]=q[q[n-3]-1]+q[n-q[n-4]-1]); vector(10000, n, q[n])

A285588 a(1) = a(2) = 1; a(3) = a(4) = a(5) = 2; a(n) = a(a(n-3)-1) + a(n-a(n-5)-2) for n > 5.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 11, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 16, 17, 17, 17, 19, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 22, 23, 23, 24, 24, 24, 25, 25, 25, 28, 27
Offset: 1

Views

Author

Altug Alkan, Apr 22 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = a[2] = 1; a[3] = a[4] = a[5] = 2; a[n_] := a[n] = a[a[n - 3] - 1] + a[n - a[n - 5] - 2]; Array[a, 80] (* Michael De Vlieger, Apr 23 2017 *)
  • PARI
    q=vector(10000); q[1]=q[2]=1;q[3]=q[4]=q[5]=2; for(n=6, #q, q[n]=q[q[n-3]-1]+q[n-q[n-5]-2]); vector(10000, n, q[n])

A087834 a[n] =a[a[a[n-1]]] + a[n -1- a[n-2]].

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 7, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17
Offset: 1

Views

Author

Roger L. Bagula, Oct 07 2003

Keywords

Comments

Triple recursion version of A055748.

Crossrefs

Cf. A055748.

Programs

  • Mathematica
    hg[n_Integer?Positive] := hg[n] =hg[hg[hg[n-1]]] + hg[n -1- hg[n-2]] hg[1] = hg[2] = 1 digits=200 a=Table[hg[n], {n, 1, digits}]

A330631 a(n+1) = a(n-a(n))+1 if a(n) > a(n-1), otherwise a(n+1) = 2*a(n); a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 4, 3, 6, 3, 6, 5, 10, 3, 6, 7, 7, 14, 3, 6, 4, 8, 4, 8, 8, 16, 4, 8, 7, 14, 8, 16, 8, 16, 15, 30, 3, 6, 17, 9, 18, 5, 10, 9, 18, 5, 10, 4, 8, 19, 9, 18, 17, 34, 7, 14, 6, 12, 6, 12, 5, 10, 19, 10, 20, 19, 38, 8, 16, 18, 19, 19, 38, 16, 32
Offset: 1

Views

Author

Rok Cestnik, Dec 21 2019

Keywords

Comments

a(n) < n (with exception a(1) = 1). Proof: Suppose a(s) = s+x, x >= 0, is the first occurrence of a(n) >= n. From here we branch into two possibilities: Possibility #1: a(s-2) < a(s-1), from which it follows that a(s) = a(s-1-a(s-1))+1 and therefore a(s-1-a(s-1)) = s-1+x is an earlier example of a(n) >= n. Possibility #2: a(s-2) >= a(s-1) and the terms can be expressed as a(s-1) = (s+x)/2 and a(s-2) = (s+x)/2+y with y >= 0. From this it follows that a(s-2-((s+x)/2+y))+1 = (s+x)/2, which when simplified reveals that a((s+x)/2-2-x-y) = (s+x)/2-1 is an earlier example of a(n) >= n. Both possibilities lead to a contradiction of the first statement, therefore we conclude that there is no occurrence of a(n) >= n (with exception a(1) = 1).
Some numbers never seem to appear in the sequence; the smallest of these are 328, 329, 331, 332, 333, 445, 667, 668, 669, ...

Examples

			a(3) = 2*a(2) = 2 because a(2) <= a(1).
a(4) = a(3-a(3))+1 = 2 because a(3) > a(2).
		

Crossrefs

See A281130 for a similar sequence.

Programs

  • Mathematica
    Nest[Append[#, If[Less @@ Take[#, -2], #[[Length@ # - #[[-1]] ]] + 1, 2 #[[-1]] ]] &, {1, 1}, 73] (* Michael De Vlieger, Dec 23 2019 *)
  • Python
    a = [1,1]
    for n in range(1, 1000):
        if(a[n] > a[n-1]):
            a.append(a[n-a[n]]+1)
        else:
            a.append(2*a[n])
Previous Showing 11-15 of 15 results.