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.

A364604 Lexicographically earliest sequence, where after every appearance, a term is banned from re-appearing for twice as long as last time; first appearance bans it for 1 term.

Original entry on oeis.org

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

Views

Author

Rok Cestnik, Jul 29 2023

Keywords

Examples

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

Crossrefs

Programs

  • PARI
    A364604(N) = {my(a=vector(N),z=1); for(s=1,N, if(a[s],next); my(m=-1); for(i=s,N, if(!a[i], a[i]=z; i+=(1<<(m++)))); z++); a}
    
  • Python
    def A364604(N):
        a = [0]*N; z=s=0
        while(s