OFFSET
1,11
LINKS
Rok Cestnik, Table of n, a(n) for n = 1..9999
Rok Cestnik, Visualization
PROG
(C)
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
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;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Rok Cestnik, Aug 23 2018
STATUS
approved