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 21-24 of 24 results.

A316626 a(1)=a(2)=a(3)=1; a(n) = a(n-2*a(n-1))+a(n-1-2*a(n-2)) for n > 3.

Original entry on oeis.org

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

Views

Author

Nathan Fox and Altug Alkan, Jul 08 2018

Keywords

Comments

This sequence increases slowly, and each term repeats at least three times.
If k is not a power of 2, then k appears in this sequence the same number of times as it appears in A081832. Otherwise, it appears exactly one additional time.

Crossrefs

Programs

  • GAP
    a:=[1,1,1];; for n in [4..80] do a[n]:=a[n-2*a[n-1]]+a[n-1-2*a[n-2]]; od; a; # Muniru A Asiru, Jul 09 2018
  • Magma
    [n le 3 select 1  else Self(n-2*Self(n-1))+Self(n-1-2*Self(n-2)): n in [1..100]]; // Vincenzo Librandi, Jul 09 2018
    
  • Maple
    A316626:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 1: elif n = 2 then 1: elif n = 3 then 1: else A316626(n-2*A316626(n-1)) + A316626(n-1-2*A316626(n-2)): fi: end:

Formula

a(n+1)-a(n)=1 or 0.
a(n)/n -> C=1/4.

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

Original entry on oeis.org

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

Views

Author

Nathan Fox, Jul 08 2018

Keywords

Comments

This sequence increases slowly.
If k is not a power of 2, k occurs A001511(k) times. Otherwise, k occurs A001511(k)-1 times.
This is the meta-Fibonacci sequence for s=-1.

References

  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138. See Eq. (2).

Crossrefs

Programs

  • GAP
    a:=[2,3];; for n in [3..75] do a[n]:=a[n+1-a[n-1]]+a[n-a[n-2]]; od; a; # Muniru A Asiru, Jul 09 2018
  • Magma
    I:=[2,3]; [n le 2 select I[n] else Self(n+1-Self(n-1))+Self(n-Self(n-2)): n in [1..100]]; // Vincenzo Librandi, Jul 09 2018
    
  • Maple
    A316627:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 2: elif n = 2 then 3: else A316627(n + 1-A316627(n-1)) + A316627(n-A316627(n-2)): fi: end:

Formula

a(n+1)-a(n)=1 or 0.
a(n)/n -> C=1/2.

A340619 n appears A006519(n) times.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 13 2021

Keywords

Comments

This sequence has similarities with the Cantor staircase function.
This sequence can be seen as an irregular table where the n-th row contains A006519(n) times the value n.
For any k > 1, the set of points { (n, a(n)), n = 1..A006520(2^k-1) } is symmetric; for example, for k = 3, we have the following configuration:
a(n)
^
| *
| **
| *
| ****
| *
| **
|*
+-------------> n

Examples

			The first rows, alongside A006519(n), are:
    n | n-th row               | A006519(n)
   ---+------------------------+-----------
    1 | 1                      |          1
    2 | 2, 2                   |          2
    3 | 3                      |          1
    4 | 4, 4, 4, 4             |          4
    5 | 5                      |          1
    6 | 6, 6                   |          2
    7 | 7                      |          1
    8 | 8, 8, 8, 8, 8, 8, 8, 8 |          8
    9 | 9                      |          1
   10 | 10, 10                 |          2
		

Crossrefs

See A061392 and A340500 for similar sequences.

Programs

  • Mathematica
    A340619[n_] := Array[n &, Table[BitAnd[BitNot[i - 1], i], {i, 1, n}][[n]]];
    Table[A340619[n], {n, 1, 26}] // Flatten (* Robert P. P. McKone, Jan 19 2021 *)
  • PARI
    concat(apply(v -> vector(2^valuation(v,2), k, v), [1..26]))
    
  • PARI
    a(n) = my(ret=0); forstep(k=logint(n,2),0,-1, if(n > k<<(k-1), ret+=1<Kevin Ryde, Jan 18 2021

Formula

a(A006520(n)) = n.
a(A006520(n)+1) = n+1.
a(n) + a(A006520(2^k-1) + 1 - n) = 2^k for any k > 0 and n = 1..A006520(2^k-1).
a(n) = 2^k + (a(r) if r>0), where k such that k*2^(k-1) < n <= (k+1)*2^k and r = n - (k+2)*2^(k-1). - Kevin Ryde, Jan 18 2021

A339310 a(n) = a(n-1-a(n-1)) + a(n-a(n-2)) for n>2; starting with a(1) = a(2) = 1.

Original entry on oeis.org

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

Views

Author

Pablo Hueso Merino, Dec 02 2020

Keywords

Comments

{a(n)} is the Pinn F 1,0(n) sequence (see link section).

Examples

			a(3)=2 because a(3) = a(3-1-a(3-1))+a(3-a(3-2)) = a(2-1)+a(3-1) = 1+1 = 2.
		

Crossrefs

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - 1 - a[n - 1]] + a[n - a[n - 2]]; Table[ a[n], {n, 1, 40}]
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = 1; for (n=3, nn, va[n]=va[n-1-va[n-1]]+va[n-va[n-2]];); va;} \\ Michel Marcus, Dec 07 2020
  • Python
    a=[1,1]
    for n in range(100):
        i1=len(a)-1-a[len(a)-1]
        i2=len(a)-a[len(a)-2]
        if i1>=0 and i2>=0 :
            a.append(a[i1]+a[i2])
        else :
            print("Sequence dies. Contains ", n+2, " terms.")
            break
    print(a)
    
Previous Showing 21-24 of 24 results.