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.

A217833 The largest number not exceeding n^2, such that there are no terms of the sequence in the interval (a(n-1)/2, a(n)/2), with a(0)=0, a(1)=1.

This page as a plain text file.
%I A217833 #33 May 21 2022 08:28:47
%S A217833 0,1,2,4,8,16,32,49,64,81,98,121,128,162,196,225,242,256,324,361,392,
%T A217833 441,450,484,512,625,648,722,784,841,882,900,968,1024,1156,1225,1250,
%U A217833 1296,1444,1521,1568,1681,1682,1764,1800,1936,2048,2209,2304,2312,2450
%N A217833 The largest number not exceeding n^2, such that there are no terms of the sequence in the interval (a(n-1)/2, a(n)/2), with a(0)=0, a(1)=1.
%C A217833 Every term has the form s*2^k, where s>=0 is a square and k>=0.
%H A217833 Alois P. Heinz, <a href="/A217833/b217833.txt">Table of n, a(n) for n = 0..1000</a>
%F A217833 a(n) = min(2*a(k+1), n^2) for n>=2 and a(k) <= a(n-1)/2 < a(k+1).
%e A217833 Let us find a(6), knowing the previous terms. Since a(5) = 16 and a(4)<=16/2<a(5). Then a(6) = 2*a(5) = 32, since 32<6^2 = 36. Further, since a(5)<=a(6)/2<a(6), then a(7) = 7^2 = 49, since 49<2*a(6) = 64.
%p A217833 a:= proc(n) option remember; local i, j, k, t;
%p A217833       if n<2 then n
%p A217833     else i, j, k, t:= 0, n-1, iquo(n-1, 2), a(n-1)/2;
%p A217833          while k<>i do if a(k)<=t then i:=k else j:=k fi;
%p A217833                        k:= iquo(i+j,2) od;
%p A217833          min(n^2, 2*a(k+1))
%p A217833       fi
%p A217833     end:
%p A217833 seq (a(n), n=0..100);  # _Alois P. Heinz_, Nov 03 2012
%t A217833 a[n_] := a[n] = Module[{i, j, k, t}, If[n < 2, n,
%t A217833      {i, j, k, t} = {0, n-1, Quotient[n-1, 2], a[n-1]/2};
%t A217833      While[k != i, If[a[k] <= t, i = k, j = k]; k = Quotient[i+j, 2]];
%t A217833      Min[n^2, 2*a[k+1]]]];
%t A217833 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, May 20 2022, after _Alois P. Heinz_ *)
%Y A217833 Cf. A217689.
%K A217833 nonn
%O A217833 0,3
%A A217833 _Vladimir Shevelev_, Oct 12 2012
%E A217833 More terms from _Alois P. Heinz_, Nov 02 2012