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).

This page as a plain text file.
%I A033921 #14 Mar 16 2021 18:36:04
%S A033921 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,
%T A033921 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,
%U A033921 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
%N A033921 Largest proper substring of 2^n that is a power of 2 (0 if none).
%H A033921 Robert Israel, <a href="/A033921/b033921.txt">Table of n, a(n) for n = 0..10000</a>
%e A033921 2^15={32}768, so a(15)=32.
%p A033921 for n from 0 to 100 do
%p A033921 L[n]:= sprintf("%d",2^n);
%p A033921 A[n]:= 0;
%p A033921 for k from n-1 by -1 to 0 do
%p A033921   if StringTools[Search](L[k],L[n]) <> 0 then
%p A033921     A[n]:= 2^k; break
%p A033921   fi
%p A033921 od
%p A033921 od:
%p A033921 seq(A[n],n=0..100); # _Robert Israel_, Aug 16 2018
%Y A033921 Cf. A000079.
%K A033921 nonn,base
%O A033921 0,6
%A A033921 _N. J. A. Sloane_
%E A033921 More terms from _Patrick De Geest_, Jun 15 1998