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

A364448 Lexicographically earliest sequence where n is banned for n^2 terms after each appearance.

Original entry on oeis.org

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

Views

Author

Rok Cestnik, Jul 25 2023

Keywords

Comments

After 12427560 terms the sequence is periodic with period 2985984. The largest periodic term is 158.
The largest term is 159 which appears only 3 times: a(4942686), a(7756992) and a(9818928).
If banning for n terms the sequence just repeats [1,2,1,3] (A364447). If banning for n^3 terms the sequence continues growing forever (A364449).
The first 41 terms are shared with A028920.

Examples

			a(n)   ban 1  2  3  4  5  6  7  ...
 1         |  |  |  |  |  |  |
 2         x  |  |  |  |  |  |
 1         |  x  |  |  |  |  |
 3         x  x  |  |  |  |  |
 1         |  x  x  |  |  |  |
 4         x  x  x  |  |  |  |
 1         |  |  x  x  |  |  |
 2         x  |  x  x  |  |  |
 1         |  x  x  x  |  |  |
 5         x  x  x  x  |  |  |
 1         |  x  x  x  x  |  |
 6         x  x  x  x  x  |  |
 1         |  |  x  x  x  x  |
 2         x  |  |  x  x  x  |
 1         |  x  |  x  x  x  |
 3         x  x  |  x  x  x  |
 1         |  x  x  x  x  x  |
 7         x  x  x  x  x  x  |
 .
 .
 .
		

Crossrefs

Programs

  • C
    #include
    int main(void){
        int N = 1000;
        int *a = (int*)malloc((N+1)*sizeof(int));
        int *ban = (int*)malloc(160*sizeof(int));
        for(int n = 0; n < N; ++n){
            for(int can = 1; can < 160; ++can){
                if(ban[can] == 0){
                    a[n] = can;
                    ban[can] = can*can+1;
                    break;
                }
            }
            for(int can = 1; can < 160; ++can) if(ban[can]) --ban[can];
        }
        free(a); free(ban);
        return 0;
    }
  • Python
    a = []
    ban = [0 for n in range(160)]
    for i in range(1000):
        can = ban.index(0,1)
        ban = [max(b-1,0) for b in ban]
        a.append(can)
        ban[can] = can**2
    

Formula

a(n) = a(n-2985984) for n >= 15413545.

A364449 Lexicographically earliest sequence where n is banned for n^3 terms after each appearance.

Original entry on oeis.org

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

Views

Author

Rok Cestnik, Jul 25 2023

Keywords

Comments

Sequence is unbounded. The fastest branch grows asymptotically linearly: limsup a(n)/n > 1-Sum_{n>0} 1/(n^3+1) = 1-A339606 = 0.313496...
If banning for n terms (A364447), or n^2 terms (A364448), the sequence is eventually periodic.

Examples

			a(n)   ban 1  2  3  4  5  6  7  ...
 1         |  |  |  |  |  |  |
 2         x  |  |  |  |  |  |
 1         |  x  |  |  |  |  |
 3         x  x  |  |  |  |  |
 1         |  x  x  |  |  |  |
 4         x  x  x  |  |  |  |
 1         |  x  x  x  |  |  |
 5         x  x  x  x  |  |  |
 1         |  x  x  x  x  |  |
 6         x  x  x  x  x  |  |
 1         |  |  x  x  x  x  |
 2         x  |  x  x  x  x  |
 1         |  x  x  x  x  x  |
 7         x  x  x  x  x  x  |
 1         |  x  x  x  x  x  x
 .
 .
 .
		

Crossrefs

Programs

  • Python
    a = []
    ban = [0 for n in range(500)]
    for i in range(1000):
        can = ban.index(0,1)
        ban = [max(b-1,0) for b in ban]
        a.append(can)
        ban[can] = can**3
Showing 1-2 of 2 results.