%I #25 Sep 13 2017 03:32:45
%S 1,3,7,13,23,41,98,223,437,699,1213,2624,4674,11163,21300,40858,73977,
%T 148591,297394,567076,1100738,2243474,4340628,8726122,17397270,
%U 34701556,68372147,136254352,271069771,546613630,1088921640,2163138108,4334318825
%N First appearance of 2^n in A281130.
%C Conjecture: a(n) ~ 2^n.
%H Rok Cestnik, <a href="/A281131/a281131_2.c.txt">C program (utilizing hard drive memory)</a>
%e a(1) = 3 because A281130(3) = 2^1 and A281130(i) != 2^1 for i < 3.
%e a(2) = 7 because A281130(7) = 2^2 and A281130(i) != 2^2 for i < 7.
%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; 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. *)
%o (C)
%o #include<stdio.h>
%o #include<stdlib.h>
%o int main(void){
%o int N = 1000000000;
%o int *a = (int*)malloc((N+1)*sizeof(int));
%o int max = 1;
%o int maxindex = 1;
%o a[1] = 1;
%o a[2] = 1;
%o for(int i = 2; i < N; ++i){
%o if(a[i-1] < a[i]) a[i+1] = a[i-a[i]];
%o else a[i+1] = 2*a[i];
%o if(a[i+1] > max){
%o max = a[i+1];
%o printf("%d %d\n", maxindex, i+1);
%o maxindex++;
%o }
%o }
%o return 0;
%o }
%Y Cf. A281130, A291598.
%K nonn,hard
%O 0,2
%A _Rok Cestnik_, Jan 15 2017
%E a(31)-a(32) from _Rok Cestnik_, Aug 27 2017
|