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.

A004759 Binary expansion starts 111.

Original entry on oeis.org

7, 14, 15, 28, 29, 30, 31, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244
Offset: 1

Views

Author

Keywords

Comments

This is the minimal recursive sequence such that a(1)=7, A007814(a(n))= A007814(n) and A010060(a(n))=A010060(n). - Vladimir Shevelev, Apr 23 2009

Examples

			30 in binary is 11110, so 30 is in sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a004759 n = a004759_list !! (n-1)
    a004759_list = 7 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004759_list
    -- Reinhard Zumkeller, Dec 03 2015
    
  • Mathematica
    w = {1, 1, 1}; Select[Range[5, 244], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 10 2016 *)
    Sort[FromDigits[#,2]&/@(Flatten[Table[Join[{1,1,1},#]&/@Tuples[{1,0},n],{n,0,5}],1])] (* Harvey P. Dale, Sep 01 2016 *)
  • PARI
    a(n)=n+6*2^floor(log(n)/log(2))
    
  • Python
    def A004759(n): return n+(3<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 6[n==0].
a(n) = n + 6 * 2^floor(log_2(n)) = A004758(n) + A053644(n).
a(n+1) = min{m > a(n): A007814(m) = A007814(n+1) and A010060(m) = A010060(n+1)}. a(2^k) - a(2^k-1) = A103204(k+2), k >= 1. - Vladimir Shevelev, Apr 23 2009
a(2^m+k) = 7*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003