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.
%I A110502 #17 Sep 01 2021 22:22:55 %S A110502 16,33,48,66,67,80,97,112,132,133,134,135,144,161,176,194,195,208,225, %T A110502 240,264,265,266,267,268,269,270,271,272,289,304,322,323,336,353,368, %U A110502 388,389,390,391,400,417,432,450,451,464,481,496,512,528,529,530,531 %N A110502 Numbers n such that n in binary representation has a block of exactly a nontrivial square number of zeros. %C A110502 a(n) is the index of zeros in the complement of the square analog of the Baum-Sweet sequence, which is b(n) = 1 if the binary representation of n contains no block of consecutive zeros of exactly a nontrivial square number length; otherwise b(n) = 0. %D A110502 J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 157. %H A110502 Robert Israel, <a href="/A110502/b110502.txt">Table of n, a(n) for n = 1..10000</a> %H A110502 J.-P. Allouche, <a href="http://www.mat.univie.ac.at/~slc/s/s30allouche.html">Finite Automata and Arithmetic</a>, Séminaire Lotharingien de Combinatoire, B30c (1993), 23 pp. %F A110502 a(n) is in this sequence iff n (base 2) has a block (not a sub-block) of k^2 = A000290(k) consecutive zeros for k>1. %e A110502 a(1) = 16 because 16 (base 2) = 10000, which has a block of 4 = 2^2 zeros. %e A110502 a(2) = 33 because 33 (base 2) = 100001, which has a block of 4 zeros. %e A110502 a(3) = 48 because 48 (base 2) = 110000, which has a block of 4 zeros. %e A110502 a(49) = 512 because 512 (base 2) = 1000000000, with a block of 9 = 3^2 zeros. %e A110502 Similarly, there are blocks of exactly 9 zeros in 1025, 1536, 2050, 2051, 3073, 3584, 7149, 8196, 8197, 8198, 8199. %e A110502 65536, 131073, 196608, 262146 and 262147 are in this sequence because (base 2) they each have a block of 16 = 4^2 zeros. %e A110502 33554432 has a block of 25 = 5^2 zeros. %p A110502 filter:= proc(n) local L,nL,A,B; %p A110502 L:= convert(n,base,2); %p A110502 nL:= nops(L); %p A110502 A:= select(t -> L[t]=0 and (t=1 or L[t-1]=1), [$1..nL]); %p A110502 B:= select(t -> L[t]=1 and L[t-1]=0, [$2..nL]); %p A110502 ormap(t -> t>3 and issqr(t),B-A) %p A110502 end proc:select(filter, [$1..1000]); # _Robert Israel_, Sep 01 2021 %t A110502 Select[Range[531], Or @@ (First[ # ] == 0 && Length[ # ] > 1 && IntegerQ[Length[ # ]^(1/2)] &) /@ Split[IntegerDigits[ #, 2]] &] (* _Ray Chandler_, Sep 12 2005 *) %o A110502 (Python) %o A110502 from math import isqrt %o A110502 from itertools import groupby %o A110502 def is_nt_sqr(n): # is nontrivial square %o A110502 return n > 1 and isqrt(n)**2 == n %o A110502 def ok(n): %o A110502 b = bin(n)[2:] %o A110502 return any(k == '0' and is_nt_sqr(len(list(g))) for k, g in groupby(b)) %o A110502 print(list(filter(ok, range(532)))) # _Michael S. Branicky_, Sep 01 2021 %Y A110502 Cf. A000290, A037011, A086747, A110471, A110472, A110474. %K A110502 base,easy,nonn %O A110502 1,1 %A A110502 _Jonathan Vos Post_, Sep 11 2005 %E A110502 Corrected and extended by _Ray Chandler_, Sep 12 2005