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

A319803 a(n) = A319651(n) + A038574(n).

Original entry on oeis.org

0, 2, 4, 4, 8, 12, 8, 12, 16, 10, 16, 26, 16, 26, 36, 26, 36, 42, 20, 26, 32, 26, 36, 42, 32, 42, 52, 28, 40, 68, 40, 52, 80, 68, 80, 92, 40, 52, 80, 52, 80, 108, 80, 108, 120, 68, 80, 92, 80, 108, 120, 92, 120, 132, 56, 68, 80, 68, 80, 92, 80, 92, 104, 68, 80, 92, 80, 108, 120, 92, 120, 132, 80, 92
Offset: 0

Views

Author

Seiichi Manyama, Sep 28 2018

Keywords

Comments

This sequence is different from A055946.

Crossrefs

Base b: A319785 (b=2), this sequence (b=3), A319804 (b=4), A319805 (b=5), A319806 (b=6), A319807 (b=7), A319808 (b=8), A319747 (b=9), A052008 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Reverse[#], 3] + FromDigits[#, 3] & [Sort[IntegerDigits[n, 3]]], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = my(nd=digits(n, 3)); fromdigits(vecsort(nd), 3) + fromdigits(vecsort(nd,,4), 3); \\ Michel Marcus, Sep 28 2018

A038573 a(n) = 2^A000120(n) - 1.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 7, 3, 7, 7, 15, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31, 7, 15, 15, 31, 15, 31, 31, 63, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31
Offset: 0

Views

Author

Keywords

Comments

Essentially the same sequence as A001316, which has much more information, and also A159913. - N. J. A. Sloane, Jun 05 2009
Smallest number with same number of 1's in its binary expansion as n.
Fixed point of the morphism 0 -> 01, 1 -> 13, 3 -> 37, ... = k -> k, 2k+1, ... starting from a(0) = 0; 1 -> 01 -> 0113 -> 01131337 -> 011313371337377(15) -> ..., . - Robert G. Wilson v, Jan 24 2006
From Gary W. Adamson, Jun 04 2009: (Start)
As an infinite string, 2^n terms per row starting with "1": (1; 1,3; 1,3,3,7; 1,3,3,7,3,7,7,15; 1,3,3,7,3,7,7,15,3,7,7,15,7,15,15,31;...)
Row sums of that triangle = A027649: (1, 4, 14, 46, 454, ...); where the next row sum = current term of A027649 + next term in finite difference row of A027649, i.e., (1, 3, 10, 32, 100, 308, ...) = A053581. (End)
From Omar E. Pol, Jan 24 2016: (Start)
Partial sums give A267700.
a(n) is also the number of cells turned ON at n-th generation of the cellular automaton of A267700 in a 90-degree sector on the square grid.
a(n) is also the number of Y-toothpicks added at n-th generation of the structure of A267700 in a 120-degree sector on the triangular grid. (End)
Row sums of A090971. - Nikolaos Pantelidis, Nov 23 2022

Examples

			9 = 1001 -> 0011 -> 3, so a(9)=3.
From _Gary W. Adamson_, Jun 04 2009: (Start)
Triangle read by rows:
  1;
  1, 3;
  1, 3, 3, 7;
  1, 3, 3, 7, 3, 7, 7, 15;
  1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31;
  ...
Row sums: (1, 4, 14, 46, ...) = A027649 = last row terms + new set of terms such that row 3 = (1, 3, 3, 7,) + (3, 7, 7, 15) = 14 + 32 = A027649(2) + A053581(3). (End)
The rows of this triangle converge to A159913. - _N. J. A. Sloane_, Jun 05 2009
G.f. = x + x^2 + 3*x^3 + x^4 + 3*x^5 + 3*x^6 + 7*x^7 + x^8 + 3*x^9 + 3*x^10 + 7*x^11 + ... - _Michael Somos_, Jul 24 2023
		

Crossrefs

This is Guy Steele's sequence GS(3, 6) (see A135416).
Write n in b-ary, sort digits into increasing order: this sequence (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).
Column k=0 of A340666.

Programs

  • Haskell
    a038573 0 = 0
    a038573 n = (m + 1) * (a038573 n') + m where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Oct 10 2012, Feb 07 2011
    (Python 3.10+)
    def A038573(n): return (1<Chai Wah Wu, Nov 15 2022
  • Maple
    seq(2^convert(convert(n,base,2),`+`)-1, n=0..100); # Robert Israel, Jan 24 2016
  • Mathematica
    Array[ 2^Count[ IntegerDigits[ #, 2 ], 1 ]-1&, 100 ]
    Nest[ Flatten[ # /. a_Integer -> {a, 2a + 1}] &, {0}, 7] (* Robert G. Wilson v, Jan 24 2006 *)
  • PARI
    {a(n) = 2^subst(Pol(binary(n)), x, 1) - 1};
    
  • PARI
    a(n) = 2^hammingweight(n)-1; \\ Michel Marcus, Jan 24 2016
    

Formula

a(2n) = a(n), a(2n+1) = 2*a(n)+1, a(0) = 0. a(n) = A001316(n)-1 = 2^A000120(n) - 1. - Daniele Parisse
a(n) = number of positive integers k < n such that n XOR k = n-k (cf. A115378). - Paul D. Hanna, Jan 21 2006
a(n) = f(n, 1) with f(x, y) = if x = 0 then y - 1 else f(floor(x/2), y*(1 + x mod 2)). - Reinhard Zumkeller, Nov 21 2009
a(n) = (n mod 2 + 1) * a(floor(n/2)) + n mod 2. - Reinhard Zumkeller, Oct 10 2012
a(n) = Sum_{i=1..n} C(n,i) mod 2. - Wesley Ivan Hurt, Nov 17 2017
G.f.: -1/(1 - x) + Product_{k>=0} (1 + 2*x^(2^k)). - Ilya Gutkovskiy, Aug 20 2019
G.f. A(x) = x + x^2*A(x) + (1 + 2*x)*(1 - x^2)*A(x^2). - Michael Somos, Jul 24 2023

Extensions

More terms from Erich Friedman
New definition from N. J. A. Sloane, Mar 01 2008

A319651 Largest number having in its ternary representation the same number of 0's, 1's and 2's as n.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 7, 8, 9, 12, 21, 12, 13, 22, 21, 22, 25, 18, 21, 24, 21, 22, 25, 24, 25, 26, 27, 36, 63, 36, 39, 66, 63, 66, 75, 36, 39, 66, 39, 40, 67, 66, 67, 76, 63, 66, 75, 66, 67, 76, 75, 76, 79, 54, 63, 72, 63, 66, 75, 72, 75, 78, 63, 66, 75, 66, 67, 76, 75, 76
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

Base b: A073138 (b=2), this sequence (b=3), A319720 (b=4), A319722 (b=5), A319723 (b=6), A319724 (b=7), this sequence (b=8), A319726 (b=9), A004186 (b=10).
Cf. A038574.

Programs

  • Mathematica
    Table[FromDigits[ReverseSort[IntegerDigits[n, 3]], 3], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 3),,4), 3); \\ Michel Marcus, Sep 25 2018
    
  • Python
    from gmpy2 import digits
    def A319651(n):
        return int(''.join(sorted(digits(n,3),reverse=True)),3) # Chai Wah Wu, Sep 26 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}
    end
    p A(3, 100)
    

Formula

n <= a(n) < 3n. - Charles R Greathouse IV, Aug 07 2024

A319652 Write n in 4-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 1, 5, 6, 7, 2, 6, 10, 11, 3, 7, 11, 15, 1, 5, 6, 7, 5, 21, 22, 23, 6, 22, 26, 27, 7, 23, 27, 31, 2, 6, 10, 11, 6, 22, 26, 27, 10, 26, 42, 43, 11, 27, 43, 47, 3, 7, 11, 15, 7, 23, 27, 31, 11, 27, 43, 47, 15, 31, 47, 63, 1, 5, 6, 7, 5, 21, 22, 23, 6, 22, 26, 27
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), this sequence (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).
Cf. A165012.

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*4^(i-1), i=1..nops(l)))(sort(convert(n, base, 4))):
    seq(a(n), n=0..75);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 4]], 4], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 4)), 4); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(4, 100)
    

A319653 Write n in 5-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 6, 7, 8, 9, 2, 7, 12, 13, 14, 3, 8, 13, 18, 19, 4, 9, 14, 19, 24, 1, 6, 7, 8, 9, 6, 31, 32, 33, 34, 7, 32, 37, 38, 39, 8, 33, 38, 43, 44, 9, 34, 39, 44, 49, 2, 7, 12, 13, 14, 7, 32, 37, 38, 39, 12, 37, 62, 63, 64, 13, 38, 63, 68, 69, 14, 39, 64, 69, 74, 3
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), this sequence (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n,5]],5],{n,0,100}] (* Harvey P. Dale, Feb 29 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 5)), 5); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(5, 100)
    

A319654 Write n in 6-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 1, 7, 8, 9, 10, 11, 2, 8, 14, 15, 16, 17, 3, 9, 15, 21, 22, 23, 4, 10, 16, 22, 28, 29, 5, 11, 17, 23, 29, 35, 1, 7, 8, 9, 10, 11, 7, 43, 44, 45, 46, 47, 8, 44, 50, 51, 52, 53, 9, 45, 51, 57, 58, 59, 10, 46, 52, 58, 64, 65, 11, 47, 53, 59, 65, 71, 2, 8
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), this sequence (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n,6]],6],{n,0,80}] (* Harvey P. Dale, Sep 20 2020 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 6)), 6); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(6, 100)
    

A319655 Write n in 7-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 1, 8, 9, 10, 11, 12, 13, 2, 9, 16, 17, 18, 19, 20, 3, 10, 17, 24, 25, 26, 27, 4, 11, 18, 25, 32, 33, 34, 5, 12, 19, 26, 33, 40, 41, 6, 13, 20, 27, 34, 41, 48, 1, 8, 9, 10, 11, 12, 13, 8, 57, 58, 59, 60, 61, 62, 9, 58, 65, 66, 67, 68, 69, 10, 59, 66, 73
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), this sequence (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*7^(i-1), i=1..nops(l)))(sort(convert(n, base, 7))):
    seq(a(n), n=0..73);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 7]], 7], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 7)), 7); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(7, 100)
    

A319656 Write n in 8-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, 13, 14, 15, 2, 10, 18, 19, 20, 21, 22, 23, 3, 11, 19, 27, 28, 29, 30, 31, 4, 12, 20, 28, 36, 37, 38, 39, 5, 13, 21, 29, 37, 45, 46, 47, 6, 14, 22, 30, 38, 46, 54, 55, 7, 15, 23, 31, 39, 47, 55, 63, 1, 9, 10, 11, 12, 13, 14
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), this sequence (b=8), A319657 (b=9), A004185 (b=10).
Cf. A165090.

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*8^(i-1), i=1..nops(l)))(sort(convert(n, base, 8))):
    seq(a(n), n=0..70);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 8]], 8], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 8)), 8); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(8, 100)
    

A319657 Write n in 9-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16, 17, 2, 11, 20, 21, 22, 23, 24, 25, 26, 3, 12, 21, 30, 31, 32, 33, 34, 35, 4, 13, 22, 31, 40, 41, 42, 43, 44, 5, 14, 23, 32, 41, 50, 51, 52, 53, 6, 15, 24, 33, 42, 51, 60, 61, 62, 7, 16, 25, 34, 43, 52, 61, 70, 71
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), this sequence (b=9), A004185 (b=10).
Cf. A165110.

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*9^(i-1), i=1..nops(l)))(sort(convert(n, base, 9))):
    seq(a(n), n=0..71);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 9]], 9], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 9)), 9); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(9, 100)
    
Showing 1-9 of 9 results.