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 10 results.

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

A046759 Economical numbers: write n as a product of primes raised to powers, let D(n) = number of digits in product, l(n) = number of digits in n; sequence gives n such that D(n) < l(n).

Original entry on oeis.org

125, 128, 243, 256, 343, 512, 625, 729, 1024, 1029, 1215, 1250, 1280, 1331, 1369, 1458, 1536, 1681, 1701, 1715, 1792, 1849, 1875, 2048, 2187, 2197, 2209, 2401, 2560, 2809, 3125, 3481, 3584, 3645, 3721, 4096, 4374, 4375, 4489, 4802, 4913
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

A050252(a(n)) < A055642(a(n)). - Reinhard Zumkeller, Jun 21 2011

Examples

			125 = 5^3, l(n) = 3 and D(n) = 2, so 125 is a member of the sequence.
		

References

  • Bernardo Recamán, The Bogota Puzzles, Courier Dover Publications, Inc., 2020, p. 77.

Crossrefs

Programs

  • Haskell
    a046759 n = a046759_list !! (n-1)
    a046759_list = filter (\n -> a050252 n < a055642 n) [1..]
    -- Reinhard Zumkeller, Jun 21 2011
    
  • Mathematica
    ecoQ[n_] := Total[ Length /@ IntegerDigits /@ Flatten[ FactorInteger[n] /. {p_, 1} -> p]] < Length[ IntegerDigits[n]]; Select[ Range[5000], ecoQ] (* Jean-François Alcover, Jul 28 2011 *)
  • PARI
    is(n)=my(f=factor(n));sum(i=1,#f[,1], #Str(f[i,1])+if(f[i,2]>1, #Str(f[i,2])))<#Str(n) && n>1 \\ Charles R Greathouse IV, Feb 01 2013
    
  • Python
    from sympy import factorint
    def ok(n): return n > 1 and sum(len(str(p))+(len(str(e)) if e>1 else 0) for p, e in factorint(n).items()) < len(str(n))
    print([k for k in range(5000) if ok(k)]) # Michael S. Branicky, Dec 22 2024

Extensions

More terms from Eric W. Weisstein

A046758 Equidigital numbers.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 11, 13, 14, 15, 16, 17, 19, 21, 23, 25, 27, 29, 31, 32, 35, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 105, 106, 107, 109, 111, 112, 113, 115, 118, 119, 121, 122, 123, 127, 129, 131, 133, 134, 135, 137, 139
Offset: 1

Views

Author

Keywords

Comments

Write n as product of primes raised to powers, let D(n) = A050252 = total number of digits in product representation (number of digits in all the primes plus number of digits in all the exponents that are greater than 1) and l(n) = number of digits in n; sequence gives n such that D(n)=l(n).
The term "equidigital number" was coined by Recamán (1995). - Amiram Eldar, Mar 10 2024

Examples

			For n = 125 = 5^3, l(n) = 3 but D(n) = 2. So 125 is not a member of this sequence.
		

References

  • Bernardo Recamán Santos, Equidigital representation: problem 2204, J. Rec. Math., Vol. 27, No. 1 (1995), pp. 58-59.

Crossrefs

Programs

  • Haskell
    a046758 n = a046758_list !! (n-1)
    a046758_list = filter (\n -> a050252 n == a055642 n) [1..]
    -- Reinhard Zumkeller, Jun 21 2011
    
  • Mathematica
    edQ[n_] := Total[IntegerLength[DeleteCases[Flatten[FactorInteger[n]], 1]]] == IntegerLength[n]; Join[{1}, Select[Range[140], edQ]] (* Jayanta Basu, Jun 28 2013 *)
  • PARI
    for(n=1, 100, s=""; F=factor(n); for(i=1, #F[, 1], s=concat(s, Str(F[i, 1])); s=concat(s, Str(F[i, 2]))); c=0; for(j=1, #F[, 2], if(F[j, 2]==1, c++)); if(#digits(n)==#s-c, print1(n, ", "))) \\ Derek Orr, Jan 30 2015
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A046758_gen(): # generator of terms
        return (n for n in count(1) if n == 1 or len(str(n)) == sum(len(str(p))+(len(str(e)) if e > 1 else 0) for p, e in factorint(n).items()))
    A046758_list = list(islice(A046758_gen(),20)) # Chai Wah Wu, Feb 18 2022

Formula

A050252(a(n)) = A055642(a(n)). - Reinhard Zumkeller, Jun 21 2011

Extensions

More terms from Eric W. Weisstein

A050252 Number of digits in the prime factorization of n (counting terms of the form p^1 as p).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 3, 2, 4, 2, 3, 3, 3, 2, 3, 2, 4, 3, 3, 2, 3, 2, 3, 3, 4, 2, 3, 3, 3, 3, 3, 2, 4, 2, 3, 3, 2, 3, 4, 2, 4, 3, 3, 2, 4, 2, 3, 3, 4, 3, 4, 2, 3, 2, 3, 2, 4, 3, 3, 3, 4, 2, 4, 3, 4, 3, 3, 3, 3, 2, 3, 4, 4, 3, 4
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. also A377369 (analog for base 2).

Programs

  • Haskell
    a050252 1 = 1
    a050252 n = sum $ map a055642 $
                (a027748_row n) ++ (filter (> 1) $ a124010_row n)
    -- Reinhard Zumkeller, Aug 03 2013, Jun 21 2011
    
  • Mathematica
    nd[n_]:=Total@IntegerLength@Select[Flatten@FactorInteger[n],#>1&];Table[If[n==1,1,nd[n]],{n,102}] (* Vladimir Joseph Stephan Orlovsky, Jan 30 2012 *)
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else sum(len(str(p))+(len(str(e)) if e>1 else 0) for p, e in factorint(n).items())
    print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Dec 27 2024

Formula

a(A192010(n)) = n and a(m) != n for m < A192010(n);
a(A046759(n)) < A055642(A046759(n)); a(A046758(n)) = A055642(A046758(n)); a(A046760(n)) > A055642(A046760(n)). [Reinhard Zumkeller, Jun 21 2011]

A254318 Hyper equidigital numbers.

Original entry on oeis.org

2, 3, 4, 5, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 28, 29, 31, 32, 35, 36, 37, 39, 41, 43, 46, 47, 49, 50, 53, 54, 58, 59, 61, 64, 67, 69, 71, 72, 73, 79, 81, 83, 89, 92, 93, 97, 98, 100, 101, 103, 104, 105, 106, 107, 109, 113, 116, 119
Offset: 1

Views

Author

Michel Lagneau, Jan 28 2015

Keywords

Comments

The distinction between the equidigital numbers (A046758) is that only the distinct digits are counted instead of all digits. Hence the definition:
Write n as product of primes raised to powers, let D(n) = total number of distinct digits in product representation (number of distinct digits in all the primes and number of distinct digits in all the exponents that are greater than 1) and nbd(n) = A043537(n) = number of distinct digits in n; sequence gives n such that D(n) = nbd(n).

Examples

			116 is in the sequence because 116 = 2^2*29 => D(116)= A043537(116)=2.
		

Crossrefs

Programs

  • Mathematica
    Cases[Range[400], n_ /; Length[Union[Flatten[IntegerDigits[FactorInteger[n] /. 1 -> Sequence[]]]]]==Length[Union[Flatten[IntegerDigits[n]]]]]
  • PARI
    for(n=1,100,s=[];F=factor(n);for(i=1,#F[,1],s=concat(s,digits(F[i,1]));if(F[i,2]>1,s=concat(s,digits(F[i,2]))));if(#vecsort(digits(n),,8)==#vecsort(s,,8),print1(n,", "))) \\ Derek Orr, Jan 30 2015

A379373 Numbers k such that A050252(k) <= A055642(k).

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 11, 13, 14, 15, 16, 17, 19, 21, 23, 25, 27, 29, 31, 32, 35, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 105, 106, 107, 109, 111, 112, 113, 115, 118, 119, 121, 122, 123, 125, 127, 128, 129, 131, 133, 134, 135
Offset: 1

Views

Author

Paolo Xausa, Dec 21 2024

Keywords

Comments

Some authors call these numbers "economical numbers" (see links) and refer to A046759 as "frugal numbers", while other authors define "economical numbers" to be A046759.
First differs from A046758 at n = 54, where a(54) = 125 is missing from A046758.

Examples

			112 is a term because 112 = (2^4)*7; the total number of digits of (2, 4, 7) = 1 + 1 + 1 <= the number of digits of 112 (3).
125 is a term because 125 = 5^3; the total number of digits of (5, 3) = 1 + 1 <= the number of digits of 125 (3).
		

Crossrefs

Union of A046758 and A046759.
Complement of A046760.

Programs

  • Mathematica
    A379373Q[k_] := Total[IntegerLength[Select[Flatten[FactorInteger[k]], # > 1 &]]] <= IntegerLength[k];
    Select[Range[200], A379373Q]
  • Python
    from sympy import factorint
    def ok(n): return n > 0 and sum(len(str(p))+(len(str(e)) if e>1 else 0) for p, e in factorint(n).items()) <= len(str(n))
    print([k for k in range(136) if ok(k)]) # Michael S. Branicky, Dec 22 2024

A254319 Hyper economical numbers.

Original entry on oeis.org

27, 108, 125, 128, 129, 135, 138, 143, 159, 160, 184, 187, 189, 196, 207, 209, 216, 219, 243, 249, 256, 259, 265, 276, 295, 297, 329, 341, 351, 375, 403, 429, 451, 458, 469, 497, 512, 529, 621, 625, 671, 679, 729, 781, 795, 837, 841, 892, 896, 908, 916, 932
Offset: 1

Views

Author

Michel Lagneau, Jan 28 2015

Keywords

Comments

The distinction between the economical numbers (A046759) is that the distinct digits are counted only instead all digits. Hence the definition:
Write n as product of primes raised to powers, let D(n) = total number of distinct digits in product representation (number of distinct digits in all the primes and number of distinct digits in all the exponents that are greater than 1) and nbd(n) = A043537(n) number of distinct digits in n; sequence gives n such that D(n) < nbd(n).

Examples

			27 is in the sequence because 27 = 3 ^ 3 => D(27)= 1 < nbd(27)=2.
		

Crossrefs

Programs

  • Mathematica
    Cases[Range[400], n_ /; Length[Union[Flatten[IntegerDigits[FactorInteger[n] /. 1 -> Sequence[]]]]]< Length[Union[Flatten[IntegerDigits[n]]]]]
  • PARI
    for(n=1,10^3,s=[];F=factor(n);for(i=1,#F[,1],s=concat(s,digits(F[i,1]));if(F[i,2]>1,s=concat(s,digits(F[i,2]))));if(#vecsort(digits(n),,8)>#vecsort(s,,8),print1(n,", "))) \\ Derek Orr, Jan 30 2015

A254321 Hyper Wasteful numbers.

Original entry on oeis.org

6, 8, 9, 22, 26, 30, 33, 34, 38, 40, 42, 44, 45, 48, 51, 52, 55, 56, 57, 60, 62, 63, 65, 66, 68, 70, 74, 75, 76, 77, 78, 80, 82, 84, 85, 86, 87, 88, 90, 91, 94, 95, 96, 99, 102, 110, 111, 112, 114, 115, 117, 118, 122, 130, 133, 136, 141, 144, 152, 153, 155, 161
Offset: 1

Views

Author

Michel Lagneau, Jan 28 2015

Keywords

Comments

The distinction between the Wasteful numbers (A046760) is that the distinct digits are counted only instead all digits. Hence the definition:
Write n as product of primes raised to powers, let D(n) = total number of distinct digits in product representation (number of distinct digits in all the primes and number of distinct digits in all the exponents that are greater than 1) and nbd(n) = A043537(n) = number of distinct digits in n; sequence gives n such that D(n) > nbd(n).

Examples

			88 is in the sequence because 88 = 2 ^ 3 * 11 => D(88)=3 > nbd(88)=1.
		

Crossrefs

Programs

  • Mathematica
    Cases[Range[400], n_ /; Length[Union[Flatten[IntegerDigits[FactorInteger[n] /. 1 -> Sequence[]]]]] > Length[IntegerDigits[n]]]
  • PARI
    for(n=1,100,s=[];F=factor(n);for(i=1,#F[,1],s=concat(s,digits(F[i,1]));if(F[i,2]>1,s=concat(s,digits(F[i,2]))));if(#vecsort(digits(n),,8)<#vecsort(s,,8),print1(n,", "))) \\ Derek Orr, Jan 30 2015

A172460 Partial sums of economical numbers A046759.

Original entry on oeis.org

125, 253, 496, 752, 1095, 1607, 2232, 2961, 3985, 5014, 6229, 7479, 8759, 10090, 11459, 12917, 14453, 16134, 17835, 19550, 21342, 23191, 25066, 27114, 29301, 31498, 33707, 36108, 38668, 41477, 44602, 48083, 51667, 55312, 59033, 63129
Offset: 1

Views

Author

Jonathan Vos Post, Feb 03 2010

Keywords

Comments

The subsequence of prime partial sum of economical numbers begins: 1607, 6229, 12917, 76367. The subsequence of economical partial sum of economical numbers begins: 125; what is the first nontrivial economical partial sum of economical numbers?

Examples

			a(41) = 125 + 128 + 243 + 256 + 343 + 512 + 625 + 729 + 1024 + 1029 + 1215 + 1250 + 1280 + 1331 + 1369 + 1458 + 1536 + 1681 + 1701 + 1715 + 1792 + 1849 + 1875 + 2048 + 2187 + 2197 + 2209 + 2401 + 2560 + 2809 + 3125 + 3481 + 3584 + 3645 + 3721 + 4096 + 4374 + 4375 + 4489 + 4802 + 4913.
		

Crossrefs

Formula

a(n) = SUM[i=1..n] {n written as a product of primes raised to powers, where D(n) = number of digits in product, l(n) = number of digits in n; sequence gives n such that D(n)

A172484 Partial sums of extravagant numbers, also called prodigal numbers, or wasteful numbers.

Original entry on oeis.org

4, 10, 18, 27, 39, 57, 77, 99, 123, 149, 177, 207, 240, 274, 310, 348, 387, 427, 469, 513, 558, 604, 652, 702, 753, 805, 859, 914, 970, 1027, 1085, 1145, 1207, 1270, 1335, 1401, 1469, 1538, 1608, 1680, 1754, 1829, 1905, 1982, 2060, 2140, 2222, 2306, 2391, 2477
Offset: 1

Author

Jonathan Vos Post, Feb 04 2010

Keywords

Comments

Every natural number, written in base 10, is either economical A046759 (also called frugal), or equidigital A046758, or extravagant (or prodigal or wasteful). An extravagant number is one for which the factorization requires more digits that the original number such as 30 = 2 * 3 * 5. The subsequence of economical partial sums of extravagant numbers begins: xxx, 18, 39, 57, 77, 99, 207, 240, 274, 310. The subsequence of equidigital partial sum of economical numbers begins: 10, 27, 123, 149, 177, 427, 469 (such as 1207 = 17 * 71). The subsequence of prime partial sums of economical numbers begins: xxx, 149, 859, 2477, 2833.

Examples

			a(1) = A046760(1) = 4. a(2) = 4 + 6 = 10. a(67) = 4 + 6 + 8 + 9 + 12 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 33 + 34 + 36 + 38 + 39 + 40 + 42 + 44 + 45 + 46 + 48 + 50 + 51 + 52 + 54 + 55 + 56 + 57 + 58 + 60 + 62 + 63 + 65 + 66 + 68 + 69 + 70 + 72 + 74 + 75 + 76 + 77 + 78 + 80 + 82 + 84 + 85 + 86 + 87 + 88 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 98 + 99 + 100 + 102 + 104 + 108 + 110 + 114 = 4138 = 2 * 2069 which is thus an economical number, with 4 digits but 5 in its prime factorization.
		

Crossrefs

Formula

SUM[i=1..n] A046760(i) = Partial sum of {Write n as a product of primes raised to powers, let D(n) = number of digits in product, l(n) = number of digits in n; sequence gives n such that D(n)>l(n)}.

Extensions

27 inserted by R. J. Mathar, Feb 06 2010
Showing 1-10 of 10 results.