A364448 Lexicographically earliest sequence where n is banned for n^2 terms after each appearance.
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
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 | . . .
Links
- Rok Cestnik, Table of n, a(n) for n = 1..10000
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.
Comments