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.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 32, 49, 64, 81, 98, 121, 128, 162, 196, 225, 242, 256, 324, 361, 392, 441, 450, 484, 512, 625, 648, 722, 784, 841, 882, 900, 968, 1024, 1156, 1225, 1250, 1296, 1444, 1521, 1568, 1681, 1682, 1764, 1800, 1936, 2048, 2209, 2304, 2312, 2450
Offset: 0

Views

Author

Vladimir Shevelev, Oct 12 2012

Keywords

Comments

Every term has the form s*2^k, where s>=0 is a square and k>=0.

Examples

			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.
		

Crossrefs

Cf. A217689.

Programs

  • Maple
    a:= proc(n) option remember; local i, j, k, t;
          if n<2 then n
        else i, j, k, t:= 0, n-1, iquo(n-1, 2), a(n-1)/2;
             while k<>i do if a(k)<=t then i:=k else j:=k fi;
                           k:= iquo(i+j,2) od;
             min(n^2, 2*a(k+1))
          fi
        end:
    seq (a(n), n=0..100);  # Alois P. Heinz, Nov 03 2012
  • Mathematica
    a[n_] := a[n] = Module[{i, j, k, t}, If[n < 2, n,
         {i, j, k, t} = {0, n-1, Quotient[n-1, 2], a[n-1]/2};
         While[k != i, If[a[k] <= t, i = k, j = k]; k = Quotient[i+j, 2]];
         Min[n^2, 2*a[k+1]]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 20 2022, after Alois P. Heinz *)

Formula

a(n) = min(2*a(k+1), n^2) for n>=2 and a(k) <= a(n-1)/2 < a(k+1).

Extensions

More terms from Alois P. Heinz, Nov 02 2012