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.

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

This page as a plain text file.
%I A364448 #33 Jul 31 2023 10:09:41
%S A364448 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,
%T A364448 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,
%U A364448 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
%N A364448 Lexicographically earliest sequence where n is banned for n^2 terms after each appearance.
%C A364448 After 12427560 terms the sequence is periodic with period 2985984. The largest periodic term is 158.
%C A364448 The largest term is 159 which appears only 3 times: a(4942686), a(7756992) and a(9818928).
%C A364448 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).
%C A364448 The first 41 terms are shared with A028920.
%H A364448 Rok Cestnik, <a href="/A364448/b364448.txt">Table of n, a(n) for n = 1..10000</a>
%F A364448 a(n) = a(n-2985984) for n >= 15413545.
%e A364448 a(n)   ban 1  2  3  4  5  6  7  ...
%e A364448  1         |  |  |  |  |  |  |
%e A364448  2         x  |  |  |  |  |  |
%e A364448  1         |  x  |  |  |  |  |
%e A364448  3         x  x  |  |  |  |  |
%e A364448  1         |  x  x  |  |  |  |
%e A364448  4         x  x  x  |  |  |  |
%e A364448  1         |  |  x  x  |  |  |
%e A364448  2         x  |  x  x  |  |  |
%e A364448  1         |  x  x  x  |  |  |
%e A364448  5         x  x  x  x  |  |  |
%e A364448  1         |  x  x  x  x  |  |
%e A364448  6         x  x  x  x  x  |  |
%e A364448  1         |  |  x  x  x  x  |
%e A364448  2         x  |  |  x  x  x  |
%e A364448  1         |  x  |  x  x  x  |
%e A364448  3         x  x  |  x  x  x  |
%e A364448  1         |  x  x  x  x  x  |
%e A364448  7         x  x  x  x  x  x  |
%e A364448  .
%e A364448  .
%e A364448  .
%o A364448 (Python)
%o A364448 a = []
%o A364448 ban = [0 for n in range(160)]
%o A364448 for i in range(1000):
%o A364448     can = ban.index(0,1)
%o A364448     ban = [max(b-1,0) for b in ban]
%o A364448     a.append(can)
%o A364448     ban[can] = can**2
%o A364448 (C)
%o A364448 #include<stdlib.h>
%o A364448 int main(void){
%o A364448     int N = 1000;
%o A364448     int *a = (int*)malloc((N+1)*sizeof(int));
%o A364448     int *ban = (int*)malloc(160*sizeof(int));
%o A364448     for(int n = 0; n < N; ++n){
%o A364448         for(int can = 1; can < 160; ++can){
%o A364448             if(ban[can] == 0){
%o A364448                 a[n] = can;
%o A364448                 ban[can] = can*can+1;
%o A364448                 break;
%o A364448             }
%o A364448         }
%o A364448         for(int can = 1; can < 160; ++can) if(ban[can]) --ban[can];
%o A364448     }
%o A364448     free(a); free(ban);
%o A364448     return 0;
%o A364448 }
%Y A364448 Cf. A364447, A364449, A028920.
%K A364448 nonn,look
%O A364448 1,2
%A A364448 _Rok Cestnik_, Jul 25 2023