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

A007091 Numbers in base 5.

Original entry on oeis.org

0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 100, 101, 102, 103, 104, 110, 111, 112, 113, 114, 120, 121, 122, 123, 124, 130, 131, 132, 133, 134, 140, 141, 142, 143, 144, 200, 201, 202, 203, 204, 210, 211, 212, 213, 214, 220, 221, 222, 223, 224, 230
Offset: 0

Views

Author

Keywords

Comments

From Rick L. Shepherd, Jun 25 2009: (Start)
Nonnegative integers with no decimal digit > 4.
Thus nonnegative integers in base 10 whose doubling by normal addition or multiplication requires no carry operation. (End)
It appears that this sequence corresponds to the numbers n for which twice the sum of digits of n is the sum of digits of 2*n. - Rémy Sigrist, Nov 22 2009

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000042 (base 1), A007088 (base 2), A007089 (base 3), A007090 (base 4), A007092 (base 6), A007093 (base 7), A007094 (base 8), A007095 (base 9).

Programs

  • Maple
    A007091 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,5): return op(convert(l,base,10,10^nops(l))): end: seq(A007091(n),n=0..58); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 5]], {n, 0, 60}]
  • PARI
    a(n)=if(n<1,0,if(n%5,a(n-1)+1,10*a(n/5)))
    
  • PARI
    apply( A007091(n)=fromdigits(digits(n,5)), [0..66]) \\ M. F. Hasler, Nov 18 2019
    
  • Python
    from gmpy2 import digits
    def A007091(n): return int(digits(n,5)) # Chai Wah Wu, Dec 26 2021

Formula

a(0)=0 a(n)=10*a(n/5) if n==0 (mod 5) a(n)=a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002
a(n) = n + 1/2*Sum_{k >= 1} 10^k*floor(n/5^k). Cf. A037454, A037462 and A102491. - Peter Bala, Dec 01 2016

A102491 Numbers whose base-20 representation can be written with decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 120, 121, 122, 123, 124, 125, 126
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 12 2005

Keywords

Comments

a(n) = A118761(n) for n<=50. - Reinhard Zumkeller, May 01 2006

Crossrefs

Complement of A102492; Cf. A102487, A102489, A102493. Cf. A037454, A037462, A007091.

Programs

  • Haskell
    import Data.List (unfoldr)
    a102491 n = a102491_list !! (n-1)
    a102491_list = filter (all (<= 9) . unfoldr
       (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 20)) [0..]
    -- Reinhard Zumkeller, Jun 27 2013
    
  • Maple
    seq(n + (1/2)*add(20^k*floor(n/10^k), k = 1..floor(ln(n)/ln(10))), n = 1..100); # Peter Bala, Dec 01 2016
  • Mathematica
    Select[Range@ 126, Total@ Take[Most@ DigitCount[#, 20], -10] == 0 &] (* Michael De Vlieger, Apr 09 2016 *)
  • PARI
    isok(n) = (n==0) || ((d=digits(n, 20)) && (vecmax(d) < 10)); \\ Michel Marcus, Apr 09 2016
    
  • PARI
    a(n) = fromdigits(digits(n-1),20) \\ Ruud H.G. van Tol, Dec 08 2022
  • Python
    A102491_list = [int(str(x), 20) for x in range(10**6)] # Chai Wah Wu, Apr 09 2016
    

Formula

From Peter Bala, Dec 01 2016: (Start)
If n = Sum_{i = 0..m} d(i)*10^i is the decimal expansion of n then a(n+1) = Sum_{i = 0..m} d(i)*20^i.
a(n+1) = n + 1/2*Sum_{k >= 1} 20^k*floor(n/10^k). Cf. A037454, A037462 and A007091.
a(1) = 0; a(n+1) = 20*a(n/10+1) if n == 0 (mod 10) else a(n+1) = a(n) + 1. (End)
G.f. g(x) satisfies g(x) = 20*Sum_{1<=k<=9} x^k*g(x^10)/x^9 + Sum_{1<=k<=9} k*x^(k+1)/(1-x^10). - Robert Israel, Dec 01 2016

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

Original entry on oeis.org

0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 64, 65, 66, 67, 72, 73, 74, 75, 80, 81, 82, 83, 88, 89, 90, 91, 128, 129, 130, 131, 136, 137, 138, 139, 144, 145, 146, 147, 152, 153, 154, 155, 192, 193, 194, 195, 200, 201, 202, 203, 208, 209, 210
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    seq(n + (1/2)*add(8^k*floor(n/4^k), k = 1..floor(ln(n)/ln(4))), n = 1..100); # Peter Bala, Dec 01 2016
  • Mathematica
    Table[FromDigits[RealDigits[n, 4], 8], {n, 0, 100}]
    (* Clark Kimberling, Aug 14 2012 *)

Formula

From Peter Bala, Dec 01 2016: (Start):
a(n) = n + 1/2*Sum_{k >= 1} 8^k*floor(n/4^k). Cf. A037454, A007091 and A102491.
a(0) = 0; a(n) = 8*a(n/4) if n == 0 (mod 4) else a(n) = a(n-1) + 1. (End)

Extensions

Offset changed to 0 by Clark Kimberling, Aug 14 2012

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

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 9, 10, 11, 12, 13, 14, 12, 13, 14, 15, 16, 17, 15, 16, 17, 18, 19, 20, 9, 10, 11, 12, 13, 14, 12, 13, 14, 15, 16, 17, 15, 16, 17, 18, 19, 20, 18, 19, 20, 21, 22, 23, 21, 22, 23, 24, 25, 26, 24, 25, 26, 27, 28, 29, 18
Offset: 1

Views

Author

Clark Kimberling, Aug 13 2012

Keywords

Crossrefs

Cf. A037454.

Programs

  • Magma
    [n eq 1 select 1 else n mod 6 eq 0 select 3*Self(n div 6) else Self(n-1)+1: n in [1..72]]; // Bruno Berselli, Jan 25 2018
  • Mathematica
    Table[FromDigits[RealDigits[n, 6], 3], {n, 0, 100}]

Formula

a(n) = 3*a(n/6) if n == 0 (mod 6); otherwise a(n) = a(n-1)+1.

A261691 Change of base from fractional base 3/2 to base 3.

Original entry on oeis.org

0, 1, 2, 6, 7, 8, 21, 22, 23, 63, 64, 65, 69, 70, 71, 192, 193, 194, 207, 208, 209, 213, 214, 215, 579, 580, 581, 621, 622, 623, 627, 628, 629, 642, 643, 644, 1737, 1738, 1739, 1743, 1744, 1745, 1866, 1867, 1868, 1881, 1882, 1883, 1887, 1888, 1889, 1929, 1930
Offset: 0

Views

Author

Tom Edgar, Aug 28 2015

Keywords

Comments

To obtain a(n), we interpret A024629(n) as a base 3 representation (instead of base 3/2). More precisely, if A024629(n) = A007089(m), then a(n) = m.
The digits used in fractional base 3/2 are 0, 1, and 2, which are the same as the digits used in base 3.

Examples

			The base 3/2 representation of 7 is (2,1,1); i.e., 7 = 2*(3/2)^2 + 1*(3/2) + 1. Since 2*(3^2) + 1*3 + 1*1 = 22, we have a(7) = 22.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, 3 * a[2 * Floor[n/3]] + Mod[n, 3]]; Array[a, 100, 0] (* Amiram Eldar, Aug 04 2025 *)
  • PARI
    a(n) = { my (v=0, t=1); while (n, v+=t*(n%3); n=(n\3)*2; t*=3); v } \\ Rémy Sigrist, Apr 06 2021
  • Sage
    def changebase(n):
        L=[n]
        i=1
        while L[i-1]>2:
            x=L[i-1]
            L[i-1]=x.mod(3)
            L.append(2*floor(x/3))
            i+=1
        return sum([L[i]*3^i for i in [0..len(L)-1]])
    [changebase(n) for n in [0..100]]
    

Formula

For n = Sum_{i=0..m} c_i*(3/2)^i with each c_i in {0,1,2}, a(n) = Sum_{i=0..m} c_i*3^i.
From Rémy Sigrist, Apr 06 2021: (Start)
Apparently:
- a(3*n) = a(3*n-1) + A003462(1+A087088(n)) for any n > 0,
- a(3*n+1) = a(3*n) + 1 for any n >= 0,
- a(3*n+2) = a(3*n+1) + 1 for any n >= 0,
(End)
Showing 1-5 of 5 results.