A318282 a(n) = (A318281(n) - 1)/3.
0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0, 2, 0, 2, 0, 2, 1, 0, 1, 0, 1, 1, 2, 2, 3, 0, 3, 1, 2, 1, 0, 1, 1, 2, 3, 3, 4, 2, 0, 2, 1, 4, 2, 3, 2, 2, 3, 4, 3, 0, 3, 1, 4, 2, 3, 2, 3, 3, 4, 2, 4, 4, 5, 3, 2, 3, 2, 2, 3, 4, 3, 4, 4, 5
Offset: 1
Keywords
Links
- Rok Cestnik, Table of n, a(n) for n = 1..9999
- Rok Cestnik, Visualization
Programs
-
C
#include
#include #include int main(void){ int N = 100; //number of terms int *a = (int*)malloc((N+1)*sizeof(int)); printf("1 0\n2 0\n3 0\n4 0\n"); a[1] = 0; a[2] = 0; a[3] = 0; a[4] = 0; for(int i = 4; i < N; ++i){ if(a[i-1] != a[i]) a[i+1] = a[i-(3*a[i]+1)]; else a[i+1] = a[i]+1; printf("%d %d\n", i+1, a[i+1]); } free(a); return 0; }