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.

A004756 Binary expansion starts 100.

This page as a plain text file.
%I A004756 #29 Jul 14 2022 02:38:01
%S A004756 4,8,9,16,17,18,19,32,33,34,35,36,37,38,39,64,65,66,67,68,69,70,71,72,
%T A004756 73,74,75,76,77,78,79,128,129,130,131,132,133,134,135,136,137,138,139,
%U A004756 140,141,142,143,144,145,146,147,148,149,150,151,152,153
%N A004756 Binary expansion starts 100.
%H A004756 T. D. Noe, <a href="/A004756/b004756.txt">Table of n, a(n) for n = 1..1023</a>
%H A004756 Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences ...</a>
%H A004756 Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>
%F A004756 a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 3*[n==0].
%F A004756 a(n) = n + 3 * 2^floor(log_2(n)) = A004755(n) + A053644(n).
%F A004756 a(2^m+k) = 2^(m+2) + k, m >= 0, 0 <= k < 2^m. - _Yosu Yurramendi_, Aug 07 2016
%e A004756 18 in binary is 10010, so 18 is in sequence.
%t A004756 Select[Range[4, 153], Take[IntegerDigits[#, 2], 3] == {1, 0, 0} &] (* _Michael De Vlieger_, Aug 07 2016 *)
%o A004756 (PARI) a(n)=n+3*2^floor(log(n)/log(2))
%o A004756 (Haskell)
%o A004756 import Data.List (transpose)
%o A004756 a004756 n = a004756_list !! (n-1)
%o A004756 a004756_list = 4 : concat (transpose [zs, map (+ 1) zs])
%o A004756                    where zs = map (* 2) a004756_list
%o A004756 -- _Reinhard Zumkeller_, Dec 04 2015
%o A004756 (Python)
%o A004756 def A004756(n): return n+(3<<n.bit_length()-1) # _Chai Wah Wu_, Jul 13 2022
%Y A004756 Cf. A004754 (10), A004755 (11), A004757 (101), A004758 (110), A004759 (111).
%Y A004756 Cf. A004760, A053644, A062050, A076877.
%K A004756 nonn,easy,base
%O A004756 1,1
%A A004756 _N. J. A. Sloane_
%E A004756 Edited by _Ralf Stephan_, Oct 12 2003