A291598 a(n) = log_2(A281130(n)).
0, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 3, 4, 4, 5, 2, 3, 4, 2, 3, 3, 4, 2, 3, 2, 3, 4, 4, 5, 4, 5, 3, 4, 3, 4, 2, 3, 5, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 2, 3, 4, 4, 5, 3, 4, 2, 3, 2, 3, 4, 4, 5, 4, 5, 3, 4, 3, 4, 4, 5, 5, 6
Offset: 1
Keywords
Links
- Rok Cestnik, Table of n, a(n) for n = 1..10000
- Rok Cestnik, Self-referencing visualization
- Rok Cestnik, Digit probability distributions
Programs
-
C
#include
#include #include int main(void){ int N = 100; int *a = (int*)malloc((N+1)*sizeof(int)); printf("1 0\n2 0\n"); a[1] = 0; a[2] = 0; for(int i = 2; i < N; ++i){ if(a[i-1] < a[i]) a[i+1] = a[i-(int)(pow(2,a[i]))]; else a[i+1] = a[i]+1; printf("%d %d\n", i+1, a[i+1]); } return 0; } -
Mathematica
a[n_] := a[n] = If[a[n - 2] < a[n - 1], a[n - 1 - a[n - 1]], 2 a[n - 1]]; a[1] = a[2] = 1; Array[Log2@ a@ # &, 105] (* Michael De Vlieger, Aug 29 2017 *)