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.

A281131 First appearance of 2^n in A281130.

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