login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A291598 a(n) = log_2(A281130(n)). 5

%I #14 Aug 24 2018 06:35:59

%S 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 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 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 a(n) = log_2(A281130(n)).

%H Rok Cestnik, <a href="/A291598/b291598.txt">Table of n, a(n) for n = 1..10000</a>

%H Rok Cestnik, <a href="/A291598/a291598.pdf">Self-referencing visualization</a>

%H Rok Cestnik, <a href="/A291598/a291598_1.pdf">Digit probability distributions</a>

%t 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 (C)

%o #include<stdio.h>

%o #include<stdlib.h>

%o #include<math.h>

%o int main(void){

%o int N = 100;

%o int *a = (int*)malloc((N+1)*sizeof(int));

%o printf("1 0\n2 0\n");

%o a[1] = 0;

%o a[2] = 0;

%o for(int i = 2; i < N; ++i){

%o if(a[i-1] < a[i]) a[i+1] = a[i-int(pow(2,a[i]))];

%o else a[i+1] = a[i]+1;

%o printf("%d %d\n", i+1, a[i+1]);

%o }

%o return 0;

%o }

%Y Cf. A281130, A281131.

%K nonn

%O 1,7

%A _Rok Cestnik_, Aug 27 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)