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-4 of 4 results.

A020330 Numbers whose base-2 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

3, 10, 15, 36, 45, 54, 63, 136, 153, 170, 187, 204, 221, 238, 255, 528, 561, 594, 627, 660, 693, 726, 759, 792, 825, 858, 891, 924, 957, 990, 1023, 2080, 2145, 2210, 2275, 2340, 2405, 2470, 2535, 2600, 2665, 2730, 2795, 2860, 2925, 2990, 3055, 3120, 3185, 3250
Offset: 1

Views

Author

David W. Wilson, Melia Aldridge (ma38(AT)spruce.evansville.edu)

Keywords

Comments

All differences are in union of A000051 and A001576. - Vladimir Shevelev, Dec 07 2013

Examples

			36 is a term because 36 = 100100_2, which is 100 followed by 100.
		

Crossrefs

Subsequence of A121016.
Column k=0 of A246830, column k=1 of A246834.

Programs

  • Haskell
    a020330 n = foldr (\d v -> 2 * v + d) 0 (bs ++ bs) where
       bs = a030308_row n
    -- Reinhard Zumkeller, Feb 19 2013
    
  • Magma
    [n+2*n*2^Floor(Log(2, n)): n in [1..50]]; // Vincenzo Librandi, Apr 05 2018
    
  • Maple
    a:= n-> (l-> Bits[Join]([l[],l[]]))(Bits[Split](n)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 24 2024
  • Mathematica
    Table[n + 2 n 2^Floor[Log[2, n]], {n, 50}] (* T. D. Noe, Dec 10 2013 *)
    FromDigits[#, 2] & /@ (# <> # & /@ IntegerString[Range@100, 2]) (* Hans Rudolf Widmer, Aug 24 2024 *)
  • PARI
    a(n)=n+n<<#binary(n) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    is(n)=my(L=#binary(n)\2); n>>L==bitand(n,2^L-1) \\ Charles R Greathouse IV, Mar 29 2013
    
  • Python
    def a(n): return int(bin(n)[2:]*2, 2)
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Mar 10 2021
    
  • Python
    def A020330(n): return (n<Chai Wah Wu, Feb 28 2023

Formula

a(n) = n + 2*n*2^floor(log_2(n)). - Ralf Stephan, Dec 07 2004
Sum_{n>=1} 1/a(n) = A330157. - Amiram Eldar, Oct 22 2020
a(n) = n * (2^A070939(n) + 1). - Jianing Song, Apr 10 2021

A080565 Binary expansion of n has form 11**...*1.

Original entry on oeis.org

3, 7, 13, 15, 25, 27, 29, 31, 49, 51, 53, 55, 57, 59, 61, 63, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233
Offset: 1

Views

Author

Benoit Cloitre, Feb 22 2003

Keywords

Comments

If n>3 is in the sequence so are 2n-1 and 2n+1.

Crossrefs

A004755 = union of A079946 and this sequence.
A diagonal of A246830.

Formula

a(n) = 2^floor(log[2](4*(n-1)))+2*n-1 for n>1, a(1)=3. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003
Equals 2 * A004760(n) + 1. - Ralf Stephan, Sep 16 2003

A246520 Largest number that can be written in binary as concatenation of (n - k) and (n + k), 0 <= k <= n.

Original entry on oeis.org

0, 3, 10, 20, 36, 45, 72, 104, 136, 153, 170, 208, 272, 336, 400, 464, 528, 561, 594, 627, 660, 693, 800, 928, 1056, 1184, 1312, 1440, 1568, 1696, 1824, 1952, 2080, 2145, 2210, 2275, 2340, 2405, 2470, 2535, 2600, 2665, 2730, 2880, 3136, 3392, 3648, 3904
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 04 2014

Keywords

Comments

Largest term in row n of A246830.

Crossrefs

Cf. A246830, A007088, A246701 (first dfferences).

Programs

  • Haskell
    a246520 = maximum . a246830_row
    
  • Mathematica
    Table[Max[FromDigits[#,2]&/@Table[Join[IntegerDigits[n-k,2],IntegerDigits[ n+k,2]],{k,0,n}]],{n,0,50}] (* Harvey P. Dale, Oct 02 2018 *)
  • Python
    def A246520(n):
        return(max(int(bin(n-k)[2:]+bin(n+k)[2:],2) for k in range(n+1)))
    # Chai Wah Wu, Sep 07 2014

A246831 a(n) is the concatenation of n and 3n in binary.

Original entry on oeis.org

0, 7, 22, 57, 76, 95, 210, 245, 280, 315, 350, 737, 804, 871, 938, 1005, 1072, 1139, 1206, 1273, 1340, 1407, 2882, 3013, 3144, 3275, 3406, 3537, 3668, 3799, 3930, 4061, 4192, 4323, 4454, 4585, 4716, 4847, 4978, 5109, 5240, 5371, 5502, 11137, 11396, 11655
Offset: 0

Views

Author

Alois P. Heinz, Sep 04 2014

Keywords

Examples

			a(0) = (0|0)_2 = 0.
a(1) = (1|11)_2 = 7.
a(2) = (10|110)_2 = 22.
a(3) = (11|1001)_2 = 57.
a(4) = (100|1100)_2 = 76.
a(5) = (101|1111)_2 = 95.
		

Crossrefs

Cf. A246830. Column k=3 of A246834.

Programs

  • 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:
    a:= n-> f(n, 3*n):
    seq(a(n), n=0..60);
  • Python
    def A246831(n):
        return int(bin(n)[2:]+bin(3*n)[2:],2) # Chai Wah Wu, Sep 05 2014

Formula

a(n) = A246830(2n,n).
Showing 1-4 of 4 results.