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.

A303787 a(n) = Sum_{i=0..m} d(i)*4^i, where Sum_{i=0..m} d(i)*5^i is the base-5 representation of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 48, 49, 50, 51
Offset: 0

Views

Author

Seiichi Manyama, Apr 30 2018

Keywords

Examples

			13 = 23_5, so a(13) = 2*4 + 3 = 11.
14 = 24_5, so a(14) = 2*4 + 4 = 12.
15 = 30_5, so a(15) = 3*4 + 0 = 12.
16 = 31_5, so a(16) = 3*4 + 1 = 13.
		

Crossrefs

Sum_{i=0..m} d(i)*b^i, where Sum_{i=0..m} d(i)*(b+1)^i is the base (b+1) representation of n: A065361 (b=2), A215090 (b=3), this sequence (b=4), A303788 (b=5), A303789 (b=6).

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 5)
            r += b * q
            b *= 4
        end
    r end; [a(n) for n in 0:73] |> println # Peter Luschny, Jan 03 2021
  • PARI
    a(n) = fromdigits(digits(n, 5), 4); \\ Michel Marcus, May 02 2018
    
  • Ruby
    def f(k, ary)
      (0..ary.size - 1).inject(0){|s, i| s + ary[i] * k ** i}
    end
    def A(k, n)
      (0..n).map{|i| f(k, i.to_s(k + 1).split('').map(&:to_i).reverse)}
    end
    p A(4, 100)
    

A303788 a(n) = Sum_{i=0..m} d(i)*5^i, where Sum_{i=0..m} d(i)*6^i is the base-6 representation of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55
Offset: 0

Views

Author

Seiichi Manyama, Apr 30 2018

Keywords

Examples

			16 = 24_6, so a(16) = 2*5 + 4 = 14.
17 = 25_6, so a(17) = 2*5 + 5 = 15.
18 = 30_6, so a(18) = 3*5 + 0 = 15.
19 = 31_6, so a(19) = 3*5 + 1 = 16.
		

Crossrefs

Sum_{i=0..m} d(i)*b^i, where Sum_{i=0..m} d(i)*(b+1)^i is the base (b+1) representation of n: A065361 (b=2), A215090 (b=3), A303787 (b=4), this sequence (b=5), A303789 (b=6).
Cf. A037465.

Programs

  • PARI
    a(n) = fromdigits(digits(n, 6), 5); \\ Michel Marcus, May 02 2018
  • Ruby
    def f(k, ary)
      (0..ary.size - 1).inject(0){|s, i| s + ary[i] * k ** i}
    end
    def A(k, n)
      (0..n).map{|i| f(k, i.to_s(k + 1).split('').map(&:to_i).reverse)}
    end
    p A(5, 100)
    

A303789 a(n) = Sum_{i=0..m} d(i)*6^i, where Sum_{i=0..m} d(i)*7^i is the base-7 representation of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 54, 54, 55
Offset: 0

Views

Author

Seiichi Manyama, Apr 30 2018

Keywords

Examples

			19 = 25_7, so a(19) = 2*6 + 5 = 17.
20 = 26_7, so a(20) = 2*6 + 6 = 18.
21 = 30_7, so a(21) = 3*6 + 0 = 18.
22 = 31_7, so a(22) = 3*6 + 1 = 19.
		

Crossrefs

Sum_{i=0..m} d(i)*b^i, where Sum_{i=0..m} d(i)*(b+1)^i is the base (b+1) representation of n: A065361 (b=2), A215090 (b=3), A303787 (b=4), A303788 (b=5), this sequence (b=6).
Cf. A037470.

Programs

  • PARI
    a(n) = fromdigits(digits(n, 7), 6); \\ Michel Marcus, May 02 2018
  • Ruby
    def f(k, ary)
      (0..ary.size - 1).inject(0){|s, i| s + ary[i] * k ** i}
    end
    def A(k, n)
      (0..n).map{|i| f(k, i.to_s(k + 1).split('').map(&:to_i).reverse)}
    end
    p A(6, 100)
    
Showing 1-3 of 3 results.