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-10 of 29 results. Next

A055642 Number of digits in the decimal expansion of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 0

Views

Author

Henry Bottomley, Jun 06 2000

Keywords

Comments

From Hieronymus Fischer, Jun 08 2012: (Start)
For n > 0 the first differences of A117804.
The total number of digits necessary to write down all the numbers 0, 1, 2, ..., n is A117804(n+1). (End)
Here a(0) = 1, but a different common convention is to consider that the expansion of 0 in any base b > 0 has 0 terms and digits. - M. F. Hasler, Dec 07 2018

Examples

			Examples:
999: 1 + floor(log_10(999)) = 1 + floor(2.x) = 1 + 2 = 3 or
      ceiling(log_10(999+1)) = ceiling(log_10(1000)) = ceiling(3) = 3;
1000: 1 + floor(log_10(1000)) = 1 + floor(3) = 1 + 3 = 4 or
      ceiling(log_10(1000+1)) = ceiling(log_10(1001)) = ceiling(3.x) = 4;
1001: 1 + floor(log_10(1001)) = 1 + floor(3.x) = 1 + 3 = 4 or
      ceiling(log_10(1001+1)) = ceiling(log_10(1002)) = ceiling(3.x) = 4;
		

Crossrefs

Programs

  • Haskell
    a055642 :: Integer -> Int
    a055642 = length . show  -- Reinhard Zumkeller, Feb 19 2012, Apr 26 2011
    
  • Magma
    [ #Intseq(n): n in [0..105] ];   //  Bruno Berselli, Jun 30 2011
    (Common Lisp) (defun A055642 (n) (if (zerop n) 1 (floor (log n 10)))) ; James Spahlinger, Oct 13 2012
    
  • Maple
    A055642 := proc(n)
            max(1,ilog10(n)+1) ;
    end proc:  # R. J. Mathar, Nov 30 2011
  • Mathematica
    Join[{1}, Array[ Floor[ Log[10, 10# ]] &, 104]] (* Robert G. Wilson v, Jan 04 2006 *)
    Join[{1},Table[IntegerLength[n],{n,104}]]
    IntegerLength[Range[0,120]] (* Harvey P. Dale, Jul 02 2016 *)
  • PARI
    a(n)=#Str(n) \\ M. F. Hasler, Nov 17 2008
    
  • PARI
    A055642(n)=logint(n+!n,10)+1 \\ Increasingly faster than the above, for larger n. (About twice as fast for n ~ 10^7.) - M. F. Hasler, Dec 07 2018
    
  • Python
    def a(n): return len(str(n))
    print([a(n) for n in range(121)]) # Michael S. Branicky, May 10 2022
    
  • Python
    def A055642(n): # Faster than len(str(n)) from ~ 50 digits on
        L = math.log10(n or 1)
        if L.is_integer() and 10**int(L)>n: return int(L or 1)
        return int(L)+1  # M. F. Hasler, Apr 08 2024

Formula

a(A046760(n)) < A050252(A046760(n)); a(A046759(n)) > A050252(A046759(n)). - Reinhard Zumkeller, Jun 21 2011
a(n) = A196563(n) + A196564(n).
a(n) = 1 + floor(log_10(n)) = 1 + A004216(n) = ceiling(log_10(n+1)) = A004218(n+1), if n >= 1. - Daniel Forgues, Mar 27 2014
a(A046758(n)) = A050252(A046758(n)). - Reinhard Zumkeller, Jun 21 2011
a(n) = A117804(n+1) - A117804(n), n > 0. - Hieronymus Fischer, Jun 08 2012
G.f.: g(x) = 1 + (1/(1-x))*Sum_{j>=0} x^(10^j). - Hieronymus Fischer, Jun 08 2012
a(n) = A262190(n) for n < 100; a(A262198(n)) != A262190(A262198(n)). - Reinhard Zumkeller, Sep 14 2015

A020338 Doublets: base-10 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 1010, 1111, 1212, 1313, 1414, 1515, 1616, 1717, 1818, 1919, 2020, 2121, 2222, 2323, 2424, 2525, 2626, 2727, 2828, 2929, 3030, 3131, 3232, 3333, 3434, 3535, 3636, 3737, 3838, 3939, 4040, 4141, 4242, 4343, 4444, 4545, 4646
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. concatenation of n and k*n: this sequence (k=1), A019550 (k=2), A019551 (k=3), A019552 (k=4), A019553 (k=5), A009440 (k=6), A009441 (k=7), A009470 (k=8), A009474 (k=9).

Programs

  • GAP
    Flat(List([1..2],d->List([10^(d-1)..10^d-1],n->(10^d+1)*n))); # Muniru A Asiru, Mar 31 2018
  • Haskell
    a020338 n = read (ns ++ ns) :: Integer  where ns = show n
    -- Reinhard Zumkeller, Jun 07 2015
    
  • Magma
    [Seqint(Intseq(n) cat Intseq(n)): n in [1..46]]; // Bruno Berselli, Mar 20 2013
    
  • Maple
    seq(seq((10^d+1)*n, n = 10^(d-1)..10^d-1),d=1..3); # Robert Israel, Jan 02 2015
  • Mathematica
    nxt[n_]:=Module[{idn=IntegerDigits[n], idn1=IntegerDigits[n]}, FromDigits[Join[idn, idn1]]];Array[nxt, 100] (* Vincenzo Librandi, Feb 04 2014 *)
  • PARI
    a(n) = eval(Str(n,n)); \\ Michel Marcus, Sep 10 2015
    
  • Sage
    [int(str(n)+str(n)) for n in range(1,47)] # Danny Rorabaugh, Oct 10 2015
    

Formula

a(n) = n*10^(A004216(n)+1) + n. - Reinhard Zumkeller, Aug 11 2007
G.f.: 11*x/(1-x)^2 - Sum_{d >= 1} 9*x^(10^d)*(100^d*x-10^d*x-100^d)/(1-x)^2. - Robert Israel, Jan 02 2015
a(n) = n || n. (Where "||" denotes "concatenate". See link "Concatenation".) - Halfdan Skjerning, Apr 01 2018

A000461 Concatenate n n times.

Original entry on oeis.org

1, 22, 333, 4444, 55555, 666666, 7777777, 88888888, 999999999, 10101010101010101010, 1111111111111111111111, 121212121212121212121212, 13131313131313131313131313, 1414141414141414141414141414, 151515151515151515151515151515, 16161616161616161616161616161616
Offset: 1

Views

Author

John Radu (Suttones(AT)aol.com)

Keywords

Examples

			From _Bruno Berselli_, Oct 05 2018: (Start)
.         1 * 9 = 09
.        22 * 9 = 198
.       333 * 9 = 2997
.      4444 * 9 = 39996
.     55555 * 9 = 499995
.    666666 * 9 = 5999994
.   7777777 * 9 = 69999993
.  88888888 * 9 = 799999992
. 999999999 * 9 = 8999999991
(End)
		

References

  • F. Smarandache, "Properties of the numbers", Univ. of Craiova Archives, 1975; Arizona State University Special Collections, Tempe, AZ.

Crossrefs

Programs

  • Haskell
    a000461 n = (read $ concat $ replicate n $ show n) :: Integer
    -- Reinhard Zumkeller, Apr 26 2011
    
  • Maple
    a:= n-> parse(cat(n$n)):
    seq(a(n), n=1..20);  # Alois P. Heinz, Apr 26 2011
  • Mathematica
    Table[Sum[(n)*10^(i*(Floor[Log[10, n]] + 1)), {i, 0, n - 1}], {n, 1, 30}] (* José de Jesús Camacho Medina, Dec 10 2014 *)
    Table[FromDigits[Flatten[IntegerDigits/@Table[n,{n}]]],{n,15}] (* Harvey P. Dale, Mar 01 2015 *)
    Table[FromDigits[PadRight[{},n IntegerLength[n],IntegerDigits[n]]],{n,15}] (* Harvey P. Dale, Jun 19 2016 *)
  • PARI
    a(n) = eval(concat(apply(x->Str(x), vector(n, k, n)))); \\ Michel Marcus, Oct 05 2018; Feb 12 2023
    
  • Python
    def a(n): return int(str(n)*n)
    print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Jan 22 2021

Formula

a(n) = n*(10^(n*L(n))-1)/(10^L(n)-1) where L(n) = A004216(n)+1 = floor(log_10(10n)). - Henry Bottomley, Jun 01 2000
A055642(a(n)) = n * A055642(n). - Reinhard Zumkeller, Apr 26 2011
a(n) = Sum_{i=0..n-1} (n*10^(i*(floor(log(10, n)) + 1))). - José de Jesús Camacho Medina, Dec 10 2014

A045532 Concatenate n with n-th prime.

Original entry on oeis.org

12, 23, 35, 47, 511, 613, 717, 819, 923, 1029, 1131, 1237, 1341, 1443, 1547, 1653, 1759, 1861, 1967, 2071, 2173, 2279, 2383, 2489, 2597, 26101, 27103, 28107, 29109, 30113, 31127, 32131, 33137, 34139, 35149, 36151, 37157, 38163, 39167, 40173, 41179, 42181
Offset: 1

Views

Author

Keywords

Comments

Triangular numbers are 1653, 32131, 79401, ... - Ali Adams, Feb 04 2020
The next such terms are 173340627863131 and 1454987833022905581. - Giovanni Resta, Feb 04 2020

Crossrefs

Cf. A085451. [Reinhard Zumkeller, Jun 30 2010]

Programs

  • Haskell
    a045532 n = read $ show n ++ show (a000040 n) :: Integer
    -- Reinhard Zumkeller, Jul 08 2014
    
  • Magma
    [Seqint(Intseq(NthPrime(n)) cat Intseq(n)): n in [1..45]]; // Vincenzo Librandi, Apr 13 2019
    
  • Mathematica
    Table[FromDigits[Join[IntegerDigits[n], IntegerDigits[Prime[n]]]], {n, 40}] (* Vincenzo Librandi, Apr 13 2019 *)
    #[[1]]*10^IntegerLength[#[[2]]]+#[[2]]&/@Table[{n,Prime[n]},{n,50}] (* Harvey P. Dale, Oct 11 2024 *)
  • PARI
    a(n) = eval(Str(n,prime(n))); \\ Michel Marcus, Apr 13 2019, simplified by M. F. Hasler, Feb 05 2020
    
  • Python
    from sympy import prime
    def a(n): return int(str(n) + str(prime(n)))
    print([a(n) for n in range(1, 43)]) # Michael S. Branicky, Dec 23 2021

Formula

a(n) = n*10^(A004216(A000040(n))+1) + A000040(n). - Reinhard Zumkeller, Sep 03 2002

A075110 Concatenation of n-th prime and n in decimal notation.

Original entry on oeis.org

21, 32, 53, 74, 115, 136, 177, 198, 239, 2910, 3111, 3712, 4113, 4314, 4715, 5316, 5917, 6118, 6719, 7120, 7321, 7922, 8323, 8924, 9725, 10126, 10327, 10728, 10929, 11330, 12731, 13132, 13733, 13934, 14935, 15136, 15737, 16338, 16739, 17340
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 03 2002

Keywords

Crossrefs

Cf. A045532.

Programs

  • Haskell
    a075110 n = read $ show (a000040 n) ++ show n :: Integer
    -- Reinhard Zumkeller, Jul 08 2014
    
  • Magma
    [Seqint(Intseq(n) cat Intseq(NthPrime(n))): n in [1..46]]; // Vincenzo Librandi, Mar 24 2019
  • Mathematica
    Table[FromDigits[Join[IntegerDigits[Prime[n]], IntegerDigits[n]]], {n, 40}] (* Vincenzo Librandi, Mar 24 2019 *)
  • PARI
    a(n) = eval(Str(prime(n), n)); \\ Michel Marcus, Mar 24 2019
    

Formula

a(n) = A000040(n)*10^(A004216(n)+1) + n.

A004218 a(n) = log_10(n) rounded up.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of terms in the sequence A011557 (Powers of 10) that are less than n. For n > 1, a(n) is the number of digits in n-1. - Tanya Khovanova, Jun 22 2007

Examples

			From _M. F. Hasler_, Dec 07 2018: (Start)
log_10(1) = 0, therefore a(1) = 0.
log_10(2) = 0.301..., therefore a(2) = 1.
log_10(9) = 0.954..., therefore a(9) = 1.
log_10(10) = 1, therefore a(10) = 1.
log_10(11) = 1.04..., therefore a(11) = 2.
log_10(99) = 1.9956..., therefore a(99) = 2.
log_10(100) = 2, therefore a(100) = 2.
log_10(101) = 2.004..., therefore a(101) = 3. (End)
		

Crossrefs

Programs

  • Haskell
    a004218 n = if n == 1 then 0 else 1 + a004216 (n - 1)
    
  • Maple
    A004218 := proc(n)
        ceil(log[10](n)) ;
    end proc:
    seq(A004218(n),n=1..120) ; # R. J. Mathar, May 16 2023
  • Mathematica
    Array[Ceiling[Log10[#]] &, 100] (* Amiram Eldar, Dec 08 2018 *)
  • PARI
    A004218(n)=logint(n-(n>1),10)+1 \\ M. F. Hasler, Dec 07 2018

Formula

a(1) = 0, a(n) = 1 + A004216(n-1) for n > 1. - Reinhard Zumkeller, Dec 22 2012
a(n) = A055642(n-1) for all n > 1. a(n+1) is the number of decimal digits of n if 0 is considered to have 0 digits. - M. F. Hasler, Dec 07 2018

A211666 Number of iterations log_10(log_10(log_10(...(n)...))) such that the result is < 2.

Original entry on oeis.org

0, 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, 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, 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, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Hieronymus Fischer, Apr 30 2012

Keywords

Comments

Different from A004216, A057427 and A185114.
For a general definition like "Number of iterations log_p(log_p(log_p(...(n)...))) such that the result is < q", where p > 1, q > 0, the resulting g.f. is
g(x) = (1/(1-x))*Sum_{k>=1} x^(E_{i=1..k} b(i,k)), where b(i,k)=p for i

Examples

			a(n) = 0, 1, 2, 3 for n = 1, 2, 10^2, 10^10^2 (= 1, 2, 100, 10^100).
		

Formula

With the exponentiation definition E_{i=1..n} c(i) := c(1)^(c(2)^(c(3)^(...(c(n-1)^(c(n)))...))); E_{i=1..0} c := 1; example: E_{i=1..3} 10 = 10^(10^10) = 10^10000000000, we get:
a(E_{i=1..n} 10) = a(E_{i=1..n-1} 10)+1, for n>=1.
G.f.: g(x) = (1/(1-x))*Sum_{k>=1} x^(E_{i=1..k} b(i,k)), where b(i,k)=10 for i
The explicit first terms of the g.f. are g(x) = (x^2+x^100+x^(10^100)+...)/(1-x).

A067175 Number of digits in the n-th primorial (A002110).

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 15, 17, 18, 20, 22, 24, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 56, 58, 60, 62, 64, 66, 69, 71, 73, 76, 78, 80, 82, 85, 87, 89, 92, 94, 97, 99, 101, 104, 106, 109, 111, 113, 116, 118, 121, 123, 126, 128, 131, 133
Offset: 0

Author

Lekraj Beedassy, Feb 18 2002

Keywords

Crossrefs

Cf. A002110. Essentially the same as A048856.

Programs

  • Maple
    with(numtheory): it := 1: for n from 1 to 150 do it := it*ithprime(n): printf(`%d,`,ceil(log[10](it))) od:
  • Mathematica
    Table[Floor[Log[10, Product[Prime[k], {k, n}]] + 1], {n, 0, 67}]
    Join[{1},IntegerLength/@FoldList[Times,Prime[Range[70]]]] (* Harvey P. Dale, Jan 03 2024 *)
  • PARI
    a(n) = 1 + logint(vecprod(primes(n)), 10) \\ Andrew Howroyd, Apr 24 2021
    
  • Python
    from sympy import primorial
    def a(n): return 1 if n == 0 else len(str(primorial(n)))
    print([a(n) for n in range(68)]) # Michael S. Branicky, Apr 24 2021

Extensions

Edited and extended by Robert G. Wilson v and James Sellers, Feb 19 2002
Offset corrected by Arkadiusz Wesolowski, May 04 2013

A097413 Initial decimal digit of n^9.

Original entry on oeis.org

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

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 512, 19683, 262144, 1953125, 10077696, 40353607, 134217728, 387420489, 1000000000, ...
		

Programs

  • Maple
    idd:= n -> floor(n/10^ilog10(n)):
    seq(idd(n^9),n=2..100); # Robert Israel, Jan 28 2016
  • Mathematica
    Table[IntegerDigits[n^9][[1]],{n,120}] (* Harvey P. Dale, Aug 25 2023 *)

Formula

a(n) = A000030(n^9) = floor(n^9/10^A004216(n^9)). - Robert Israel, Jan 28 2016

A064222 a(0) = 0; a(n) = DecimalDigitsSortedDecreasing(a(n-1) + 1) for n > 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 22, 32, 33, 43, 44, 54, 55, 65, 66, 76, 77, 87, 88, 98, 99, 100, 110, 111, 211, 221, 222, 322, 332, 333, 433, 443, 444, 544, 554, 555, 655, 665, 666, 766, 776, 777, 877, 887, 888, 988, 998, 999, 1000, 1100, 1110, 1111, 2111
Offset: 0

Author

Reinhard Zumkeller, Sep 21 2001

Keywords

Comments

a(n) = A004186(a(n-1) + 1). - Reinhard Zumkeller, Oct 31 2007

Crossrefs

Programs

  • Haskell
    a064222 n = a064222_list !! n
    a064222_list = iterate (a004186 . (+ 1)) 0
    -- Reinhard Zumkeller, Apr 11 2012
  • Mathematica
    NestList[FromDigits[Sort[IntegerDigits[#+1],Greater]]&,0,60] (* Harvey P. Dale, Sep 04 2011 *)

Formula

a(n+1) = (d+0^d)*10^floor(log_10(a(n)+1)) + (1-0^d)*floor(a(n)/10), where d = (a(n)+1) mod 10. - Reinhard Zumkeller, Oct 31 2007
a(n) = (ceiling( (n-G(D(n)-1))/D(n) )*(10^D(n) -1) - 10^( (G(D(n)-1)-n) mod (D(n)) ) + 1)/9, for n>0, where D(n) = floor( (sqrt(8n+1)+3)/6 ) is the number of digits in a(n), and G(k) = A027468(k) = 9*k*(k+1)/2. - Stefan Alexandru Avram, May 24 2023
Showing 1-10 of 29 results. Next