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
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,7
LINKS
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 *)
PROG
(C)
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
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;
}
CROSSREFS
Sequence in context: A097848 A308964 A124830 * A287820 A191373 A322873
KEYWORD
nonn
AUTHOR
Rok Cestnik, Aug 27 2017
STATUS
approved

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 July 22 12:01 EDT 2024. Contains 374499 sequences. (Running on oeis4.)