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.

A033921 Largest proper substring of 2^n that is a power of 2 (0 if none).

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 8, 2, 2, 4, 8, 4, 8, 16, 32, 0, 2, 4, 8, 8, 2, 4, 8, 16, 32, 64, 8, 8, 8, 8, 64, 4, 8, 8, 8, 8, 8, 8, 8, 16, 32, 8, 8, 16, 32, 64, 32, 8, 4, 8, 8, 4, 4, 8, 8, 4, 8, 8, 64, 8, 8, 16, 8, 16, 32, 64, 64, 8, 8, 16, 32, 64, 32, 8, 16, 32, 64, 4, 8, 8, 16, 32, 64, 16, 32, 64, 8, 8
Offset: 0

Views

Author

Keywords

Examples

			2^15={32}768, so a(15)=32.
		

Crossrefs

Cf. A000079.

Programs

  • Maple
    for n from 0 to 100 do
    L[n]:= sprintf("%d",2^n);
    A[n]:= 0;
    for k from n-1 by -1 to 0 do
      if StringTools[Search](L[k],L[n]) <> 0 then
        A[n]:= 2^k; break
      fi
    od
    od:
    seq(A[n],n=0..100); # Robert Israel, Aug 16 2018

Extensions

More terms from Patrick De Geest, Jun 15 1998