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.

A032937 Numbers k whose base-2 representation Sum_{i=0..m} d(i)*2^(m-i) has d(i)=0 for all odd i, excluding 0. Here m is the position of the leading bit of k.

This page as a plain text file.
%I A032937 #26 Oct 29 2024 10:27:36
%S A032937 1,2,4,5,8,10,16,17,20,21,32,34,40,42,64,65,68,69,80,81,84,85,128,130,
%T A032937 136,138,160,162,168,170,256,257,260,261,272,273,276,277,320,321,324,
%U A032937 325,336,337,340,341,512,514,520,522,544,546
%N A032937 Numbers k whose base-2 representation Sum_{i=0..m} d(i)*2^(m-i) has d(i)=0 for all odd i, excluding 0. Here m is the position of the leading bit of k.
%C A032937 Essentially the same as A126684. - _R. J. Mathar_, Jun 15 2008
%C A032937 A126684 is the primary entry for this sequence. - _Franklin T. Adams-Watters_, Aug 30 2014
%t A032937 Join[{1},Select[Range[0,600],Union[Take[IntegerDigits[#,2],{2,-1,2}]]=={0}&]] (* _Harvey P. Dale_, Sep 17 2023 *)
%o A032937 (Python)
%o A032937 from gmpy2 import digits
%o A032937 def A032937(n):
%o A032937     def bisection(f,kmin=0,kmax=1):
%o A032937         while f(kmax) > kmax: kmax <<= 1
%o A032937         while kmax-kmin > 1:
%o A032937             kmid = kmax+kmin>>1
%o A032937             if f(kmid) <= kmid:
%o A032937                 kmax = kmid
%o A032937             else:
%o A032937                 kmin = kmid
%o A032937         return kmax
%o A032937     def g(x):
%o A032937         s = digits(x,4)
%o A032937         for i in range(l:=len(s)):
%o A032937             if s[i]>'1':
%o A032937                 break
%o A032937         else:
%o A032937             return int(s,2)
%o A032937         return int(s[:i]+'1'*(l-i),2)
%o A032937     def f(x): return n+x-g(x)-g(x>>1)
%o A032937     return bisection(f,n,n) # _Chai Wah Wu_, Oct 29 2024
%Y A032937 Cf. A033053, A126684.
%K A032937 nonn,base
%O A032937 1,2
%A A032937 _Clark Kimberling_