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.

A291598 a(n) = log_2(A281130(n)).

This page as a plain text file.
%I A291598 #19 Jul 15 2025 16:03:18
%S A291598 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,
%T A291598 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,
%U A291598 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
%N A291598 a(n) = log_2(A281130(n)).
%H A291598 Rok Cestnik, <a href="/A291598/b291598.txt">Table of n, a(n) for n = 1..10000</a>
%H A291598 Rok Cestnik, <a href="/A291598/a291598.pdf">Self-referencing visualization</a>
%H A291598 Rok Cestnik, <a href="/A291598/a291598_1.pdf">Digit probability distributions</a>
%t A291598 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 *)
%o A291598 (C)
%o A291598 #include<stdio.h>
%o A291598 #include<stdlib.h>
%o A291598 #include<math.h>
%o A291598 int main(void){
%o A291598    int N = 100;
%o A291598    int *a = (int*)malloc((N+1)*sizeof(int));
%o A291598    printf("1 0\n2 0\n");
%o A291598    a[1] = 0;
%o A291598    a[2] = 0;
%o A291598    for(int i = 2; i < N; ++i){
%o A291598       if(a[i-1] < a[i]) a[i+1] = a[i-(int)(pow(2,a[i]))];
%o A291598       else a[i+1] = a[i]+1;
%o A291598       printf("%d %d\n", i+1, a[i+1]);
%o A291598    }
%o A291598    return 0;
%o A291598 }
%Y A291598 Cf. A281130, A281131.
%K A291598 nonn
%O A291598 1,7
%A A291598 _Rok Cestnik_, Aug 27 2017