|
|
A281131
|
|
First appearance of 2^n in A281130.
|
|
3
|
|
|
1, 3, 7, 13, 23, 41, 98, 223, 437, 699, 1213, 2624, 4674, 11163, 21300, 40858, 73977, 148591, 297394, 567076, 1100738, 2243474, 4340628, 8726122, 17397270, 34701556, 68372147, 136254352, 271069771, 546613630, 1088921640, 2163138108, 4334318825
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Conjecture: a(n) ~ 2^n.
|
|
LINKS
|
|
|
EXAMPLE
|
|
|
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; Function[w, Function[e, First /@ Lookup[w, 2^e]]@ Range[0, Log2@ Max@ Keys@ w]]@ PositionIndex@ Array[a, 10^7] (* Michael De Vlieger, Jan 21 2017, Version 10. *)
|
|
PROG
|
(C)
#include<stdio.h>
#include<stdlib.h>
int main(void){
int N = 1000000000;
int *a = (int*)malloc((N+1)*sizeof(int));
int max = 1;
int maxindex = 1;
a[1] = 1;
a[2] = 1;
for(int i = 2; i < N; ++i){
if(a[i-1] < a[i]) a[i+1] = a[i-a[i]];
else a[i+1] = 2*a[i];
if(a[i+1] > max){
max = a[i+1];
printf("%d %d\n", maxindex, i+1);
maxindex++;
}
}
return 0;
}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|