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.

A130890 Number of terms of A061681 having length = n in decimal representation.

Original entry on oeis.org

4, 23, 281, 2825, 28287, 282890, 2828964, 28289682, 282896825
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 08 2007

Keywords

Comments

A055642(a(n)) = n; a(n) / A130901(n) --> 1.

Examples

			a(1)=#{1,2,4,8}=4;
a(2)=#{16,17,18,19,20,22,24,26,28,30,33,36,39,42,46,50,55,60,66,72,79,86,94}=23.
		

A000030 Initial digit of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Keywords

Comments

When n - a(n)*10^[log_10 n] >= 10^[(log_10 n) - 1], where [] denotes floor, or when n < 100 and 10|n, n is the concatenation of a(n) and A217657(n). - Reinhard Zumkeller, Oct 10 2012, improved by M. F. Hasler, Nov 17 2018, and corrected by Glen Whitney, Jul 01 2022
Equivalent definition: The initial a(0) = 0 is followed by each digit in S = {1,...,9} once. Thereafter, repeat 10 times each digit in S. Then, repeat 100 times each digit in S, etc.

Examples

			23 begins with a 2, so a(23) = 2.
		

References

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

Crossrefs

Programs

  • Haskell
    a000030 = until (< 10) (`div` 10) -- Reinhard Zumkeller, Feb 20 2012, Feb 11 2011
    
  • Magma
    [Intseq(n)[#Intseq(n)]: n in [1..100]]; // Vincenzo Librandi, Nov 17 2018
    
  • Maple
    A000030 := proc(n)
        if n = 0 then
            0;
        else
            convert(n,base,10) ;
            %[-1] ;
        end if;
    end proc:
    seq(A000030(n),n=0..200) ;# N. J. A. Sloane, Feb 10 2017
  • Mathematica
    Join[{0},First[IntegerDigits[#]]&/@Range[90]] (* Harvey P. Dale, Mar 01 2011 *)
    Table[Floor[n/10^(Floor[Log10[n]])], {n, 1, 50}] (* G. C. Greubel, May 16 2017 *)
    Table[NumberDigit[n,IntegerLength[n]-1],{n,0,100}] (* Harvey P. Dale, Aug 29 2021 *)
  • PARI
    a(n)=if(n<10,n,a(n\10)) \\ Mainly for illustration.
    
  • PARI
    A000030(n)=n\10^logint(n+!n,10) \\ Twice as fast as a(n)=digits(n)[1]. Before digits() was added in PARI v.2.6.0 (2013), one could use, e.g., Vecsmall(Str(n))[1]-48. - M. F. Hasler, Nov 17 2018
    
  • Python
    def a(n): return int(str(n)[0])
    print([a(n) for n in range(85)]) # Michael S. Branicky, Jul 01 2022

Formula

a(n) = [n / 10^([log_10(n)])] where [] denotes floor and log_10(n) is the logarithm is base 10. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001
a(n) = k for k*10^j <= n < (k+1)*10^j for some j. - M. F. Hasler, Mar 23 2015

A045844 a(n+1) = a(n) + largest digit of a(n); a(0) = 1.

Original entry on oeis.org

1, 2, 4, 8, 16, 22, 24, 28, 36, 42, 46, 52, 57, 64, 70, 77, 84, 92, 101, 102, 104, 108, 116, 122, 124, 128, 136, 142, 146, 152, 157, 164, 170, 177, 184, 192, 201, 203, 206, 212, 214, 218, 226, 232, 235, 240, 244, 248, 256, 262, 268, 276, 283, 291, 300, 303, 306
Offset: 0

Views

Author

Keywords

Examples

			a(17) = 92; a(18) = 92 + 9 = 101; a(19) = 101 + 1 = 102; a(20) = 102 + 2 = 104
		

Crossrefs

Partial sums of A132137.

Programs

  • Haskell
    a045844 n = a045844_list !! n
    a045844_list = iterate a095815 1
    -- Reinhard Zumkeller, Aug 23 2011
    
  • Mathematica
    NestList[#+Max[IntegerDigits[#]]&,1,60] (* Harvey P. Dale, Oct 25 2011 *)
  • PARI
    print1(a=1);for(i=1,99,print1(","a+=vecmax(digits(a)))) \\ M. F. Hasler, Jan 14 2014

Formula

a(0) = 1; a(n) = a(n-1) + MaxDigit(a(n-1)) for n > 0 where MaxDigit(x) is the largest digit in decimal notation for an integer x.
a(n+1) = A095815(a(n)). [Reinhard Zumkeller, Aug 23 2011]

A182324 n + (initial digit of n) in decimal representation.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 24 2012

Keywords

Comments

A061681 gives iteration when starting with 1.

Crossrefs

Programs

  • Haskell
    a182324 n = n + a000030 n
    
  • Magma
    [0] cat [n+d[#d] where d is Intseq(n): n in [1..65]]; // Bruno Berselli, Apr 25 2012

Formula

a(n) = n + A000030(n).
Showing 1-4 of 4 results.