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.

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

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

Original entry on oeis.org

0, 1, 2, 6, 7, 8, 12, 13, 14, 36, 37, 38, 42, 43, 44, 48, 49, 50, 72, 73, 74, 78, 79, 80, 84, 85, 86, 216, 217, 218, 222, 223, 224, 228, 229, 230, 252, 253, 254, 258, 259, 260, 264, 265, 266, 288, 289, 290, 294, 295, 296, 300, 301, 302, 432, 433, 434, 438
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 3)
            r += b * q
            b *= 6
        end
    r end; [a(n) for n in 0:57] |> println # Peter Luschny, Jan 03 2021
  • Maple
    seq(n + (1/2)*add(6^k*floor(n/3^k), k = 1..floor(ln(n)/ln(3))), n = 1..100); # Peter Bala, Dec 01 2016
  • Mathematica
    t = Table[FromDigits[RealDigits[n, 3], 6], {n, 0, 100}]
    (* Clark Kimberling, Aug 03 2012 *)

Formula

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

Extensions

Offset changed to 0 by Clark Kimberling, Aug 03 2012
Showing 1-3 of 3 results.