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.

Showing 1-3 of 3 results.

A004755 Binary expansion starts 11.

Original entry on oeis.org

3, 6, 7, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1

Views

Author

Keywords

Comments

a(n) is the smallest value > a(n-1) (or > 1 for n=1) for which A001511(a(n)) = A001511(n). - Franklin T. Adams-Watters, Oct 23 2006

Examples

			12 in binary is 1100, so 12 is in the sequence.
		

Crossrefs

Equals union of A079946 and A080565.
Cf. A004754 (10), A004756 (100), A004757 (101), A004758 (110), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004755 n = a004755_list !! (n-1)
    a004755_list = 3 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004755_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Maple
    a:= proc(n) n+2*2^floor(log(n)/log(2)) end: seq(a(n),n=1..60); # Muniru A Asiru, Oct 16 2018
  • Mathematica
    Flatten[Table[FromDigits[#,2]&/@(Join[{1,1},#]&/@Tuples[{0,1},n]),{n,0,5}]] (* Harvey P. Dale, Feb 05 2015 *)
  • PARI
    a(n)=n+2*2^floor(log(n)/log(2))
    
  • PARI
    is(n)=n>2 && binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
    
  • Python
    f = open('b004755.txt', 'w')
    lo = 3
    hi = 4
    i = 1
    while i<16384:
        for x in range(lo,hi):
            f.write(str(i)+" "+str(x)+"\n")
            i += 1
        lo <<= 1
        hi <<= 1
    # Kenny Lau, Jul 05 2016
    
  • Python
    def A004755(n): return n+(1<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2*a(n), a(2n+1) = 2*a(n) + 1 + 2*[n==0].
a(n) = n + 2 * 2^floor(log_2(n)) = A004754(n) + A053644(n).
a(n) = 2n + A080079(n). - Benoit Cloitre, Feb 22 2003
G.f.: (1/(1+x)) * (1 + Sum_{k>=0, t=x^2^k} 2^k*(2t+t^2)/(1+t)).
a(n) = n + 2^(floor(log_2(n)) + 1) = n + A062383(n). - Franklin T. Adams-Watters, Oct 23 2006
a(2^m+k) = 2^(m+1) + 2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A079946 Numbers k whose binary expansion begins with two or more 1's and ends with at least one 0.

Original entry on oeis.org

6, 12, 14, 24, 26, 28, 30, 48, 50, 52, 54, 56, 58, 60, 62, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246
Offset: 1

Views

Author

N. J. A. Sloane, Feb 21 2003

Keywords

Comments

a(n) = b(n+1), with b(2n) = 2b(n), b(2n+1) = 2b(n)+2+4[n==0]. - Ralf Stephan, Oct 11 2003

Crossrefs

A004755 = union of this and A080565. A057547(n) = a(A014486(n)) for n >= 1.

Programs

  • Maple
    A079946 := n -> 2*(2^(1+A000523(n))+n);
  • Mathematica
    Table[Union[FromDigits[Join[{1,1},#,{0}],2]&/@Tuples[{1,0},n]],{n,0,5}]//Flatten (* Harvey P. Dale, Jan 16 2018 *)
  • PARI
    for(n=0,6, for(k=2^(n-1),2^n-1,print1((2^n+k)*2,",")))
    
  • PARI
    for(n=1,59,print1((2^(floor(log(n)/log(2))+1)+n)*2,","))
    
  • PARI
    a(n) = n*2 + 4<Ruud H.G. van Tol, May 10 2024
    
  • Python
    def A079946(n): return n+(1<Chai Wah Wu, Jul 13 2022

Formula

a(n) = 2^floor(log_2(4*n))+2*n. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003
a(n) = (2^(floor(log_2(n))+1)+n)*2. - Klaus Brockhaus, Feb 23 2003
a(2n) = 2a(n), a(2n+1) = 2a(n) + 2 + 4[n==0]. Twice A004755. - Ralf Stephan, Oct 12 2003

Extensions

Definition clarified by N. J. A. Sloane, May 10 2024

A246830 T(n,k) is the concatenation of n-k and n+k in binary; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

0, 3, 2, 10, 7, 4, 15, 20, 13, 6, 36, 29, 22, 15, 8, 45, 38, 31, 40, 25, 10, 54, 47, 72, 57, 42, 27, 12, 63, 104, 89, 74, 59, 44, 29, 14, 136, 121, 106, 91, 76, 61, 46, 31, 16, 153, 138, 123, 108, 93, 78, 63, 80, 49, 18, 170, 155, 140, 125, 110, 95, 144, 113, 82, 51, 20
Offset: 0

Views

Author

Alois P. Heinz, Sep 04 2014

Keywords

Examples

			Triangle T(n,k) begins:
   0
   3  2
  10  7  4
  15 20 13  6
  36 29 22 15  8
  45 38 31 40 25 10
  54 47 72 57 42 27 12
Triangle T(n,k) written in binary (with | denoting the concat operation) begins:
     |0
    1|1      |10
   10|10    1|11     |100
   11|11   10|100   1|101    |110
  100|100  11|101  10|110   1|111    |1000
  101|101 100|110  11|111  10|1000  1|1001  |1010
  110|110 101|111 100|1000 11|1001 10|1010 1|1011 |1100
		

Crossrefs

Column k=0 gives A020330.
T(n+1,n) gives A080565(n+1).
T(2n,n) gives A246831.
Main diagonal gives A005843.
Cf. A007088, A030308, A051162, A025581, A246520 (row maxima).

Programs

  • Haskell
    import Data.Function (on)
    a246830 n k = a246830_tabl !! n !! k
    a246830_row n = a246830_tabl !! n
    a246830_tabl = zipWith (zipWith f) a051162_tabl a025581_tabl where
       f x y = foldr (\b v -> 2 * v + b) 0 $ x |+| y
       (|+|) = (++) `on` a030308_row
    -- Reinhard Zumkeller, Sep 04 2014
    
  • Maple
    f:= proc(i, j) local r, h, k; r:=0; h:=0; k:=j;
          while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; k:=i;
          while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; r
        end:
    T:= (n, k)-> f(n-k, n+k):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    f[i_, j_] := Module[{r, h, k, m}, r=0; h=0; k=j; While[k>0, {k, m} = QuotientRemainder[k, 2]; r = r+2^h*m; h = h+1]; k=i; While[k>0, {k, m} = QuotientRemainder[k, 2]; r = r+2^h*m; h = h+1]; r]; T[n_, k_] := f[n-k, n+k]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Oct 03 2016, adapted from Maple *)
  • Python
    A246830 = []
    for n in range(10**2):
        for k in range(n):
            A246830.append(int(bin(n-k)[2:]+bin(n+k)[2:],2))
        A246830.append(2*n) # Chai Wah Wu, Sep 05 2014
Showing 1-3 of 3 results.