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.

Previous Showing 61-70 of 506 results. Next

A101337 Sum of (each digit of n raised to the power (number of digits in n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 4, 5, 8, 13, 20, 29, 40, 53, 68, 85, 9, 10, 13, 18, 25, 34, 45, 58, 73, 90, 16, 17, 20, 25, 32, 41, 52, 65, 80, 97, 25, 26, 29, 34, 41, 50, 61, 74, 89, 106, 36, 37, 40, 45, 52, 61, 72, 85, 100, 117, 49, 50, 53, 58, 65
Offset: 1

Views

Author

Gordon Hamilton, Dec 24 2004

Keywords

Comments

Sometimes referred to as "narcissistic function" (in base 10). Fixed points are the narcissistic (or Armstrong, or plus perfect) numbers A005188. - M. F. Hasler, Nov 17 2019

Examples

			a(75) = 7^2 + 5^2 = 74 and a(705) = 7^3 + 0^3 + 5^3 = 468.
a(1.02e59 - 1) = 102429587095122578993551250282047487264694110769657513064859 ~ 1.024e59 is an example of n close to the limit beyond which a(n) < n for all n. - _M. F. Hasler_, Nov 17 2019
		

Crossrefs

Programs

  • Magma
    f:=func; [f(n):n in [1..75]]; // Marius A. Burtea, Nov 18 2019
  • Mathematica
    Array[Total[IntegerDigits[#]^IntegerLength[#]]&,80] (* Harvey P. Dale, Aug 27 2011 *)
  • PARI
    a(n)=my(d=digits(n)); sum(i=1,#d, d[i]^#d) \\ Charles R Greathouse IV, Aug 10 2017
    
  • PARI
    apply( A101337(n)=vecsum([d^#n|d<-n=digits(n)]), [0..99]) \\ M. F. Hasler, Nov 17 2019
    
  • Python
    def A101337(n):
        s = str(n)
        l = len(s)
        return sum(int(d)**l for d in s) # Chai Wah Wu, Feb 26 2019
    

Formula

a(n) <= A055642(n)*9^A055642(n) with equality for all n = 10^k - 1. Write n = 10^x to get a(n) < n when 1+log_10(x+1) < (x+1)(1-log_10(9)) <=> x > 59.85. It appears that a(n) < n already for all n > 1.02*10^59. - M. F. Hasler, Nov 17 2019

Extensions

Name changed by Axel Harvey, Dec 26 2011
Edited by M. F. Hasler, Nov 17 2019

A235224 a(0) = 0, and for n > 0, a(n) = largest k such that A002110(k-1) <= n, where A002110(k) gives the k-th primorial number.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 05 2014

Keywords

Comments

For n > 0: a(n) = (length of row n in A235168) = A055642(A049345(n)).
For n > 0, a(n) gives the length of primorial base expansion of n. Also, after zero, each value n occurs A061720(n-1) times. - Antti Karttunen, Oct 19 2019

Crossrefs

Programs

  • Haskell
    a235224 n = length $ takeWhile (<= n) a002110_list
    
  • Maple
    A235224 := proc(n)
        local k;
        if n = 0 then
            0;
        else
            for k from 0 do
                if A002110(k-1) > n then
                    return k-1 ;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Apr 19 2021
  • Mathematica
    primorial[n_] := Times @@ Prime[Range[n]];
    a[n_] := TakeWhile[primorial /@ Range[0, n], # <= n &] // Length;
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 27 2021 *)
  • PARI
    A235224(n) = { my(s=0, p=2); while(n, s++; n = n\p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Oct 19 2019
    
  • PARI
    A235224(n, p=2) = if(!n,n,if(nA235224(n\p, nextprime(p+1)))); \\ (Recursive implementation) - Antti Karttunen, Oct 19 2019

Formula

From Antti Karttunen, Oct 19 2019: (Start)
a(n) = A061395(A276086(n)).
For all n >= 0, a(n) >= A267263(n).
For all n >= 1, A000040(a(n)) > A328114(n). (End)

Extensions

Name corrected to match the data by Antti Karttunen, Oct 19 2019

A028335 Number of decimal digits in n-th Mersenne prime.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 6, 10, 19, 27, 33, 39, 157, 183, 386, 664, 687, 969, 1281, 1332, 2917, 2993, 3376, 6002, 6533, 6987, 13395, 25962, 33265, 39751, 65050, 227832, 258716, 378632, 420921, 895932, 909526, 2098960, 4053946, 6320430, 7235733, 7816230, 9152052, 9808358, 11185272
Offset: 1

Views

Author

Keywords

Examples

			A000668(6) = 2^17-1 = 131071 has 6 decimal digits, so a(6) = 6.
A000668(10) = 2^89-1 = 618,970,019,642,690,137,449,562,111 has 27 digits, so a(10) = 27.
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 19.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

See A000043, which is the main entry for this sequence.

Programs

  • Maple
    seq(length(numtheory:-mersenne([i])),i=1..45); # Robert Israel, Feb 02 2018
  • Mathematica
    IntegerLength[2^Array[MersennePrimeExponent, 45] - 1] (* Jean-François Alcover, Feb 17 2018 *)
    a[n_] := Floor[MersennePrimeExponent[n]/Log2[10]] + 1; Array[a, 48] (* Amiram Eldar, Oct 16 2024 *)

Formula

a(n) = floor(A000043(n)*log(2)/log(10)) + 1.
a(n) = A055642(A000668(n)). - Michel Marcus, Apr 07 2018

Extensions

More terms from Enoch Haga, Dec 18 2001
a(38) from Harry J. Smith, Apr 17 2003
a(39) from Omar E. Pol, Oct 28 2007
a(40)-a(41) from Jason Kimberley, Jan 05 2012
a(42)-a(45) from Patrick J. McNab, Feb 01 2018

A178788 Characteristic function of numbers having distinct digits in their decimal representation.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 30 2010

Keywords

Comments

a(A010784(n)) = 1; a(A109303(n)) = 0;
first differences of A178787.
a(n) <= A196368(n).
a(n) = 0 for n > 9*9!. - Hieronymus Fischer, Feb 02 2013

Programs

  • Haskell
    import Data.List (nub)
    a178788 n = fromEnum $ nub (show n) == show n
    -- Reinhard Zumkeller, Sep 25 2011
  • Mathematica
    lst = {}; Do[If[Select[Tally[IntegerDigits[n]][[All, 2]], # > 1 &] == {}, AppendTo[lst, 1], AppendTo[lst, 0]], {n, 0, 104}]; lst (* Arkadiusz Wesolowski, May 10 2012 *)

Formula

a(n) = 0^(A055642(n)-A043537(n)).

A060384 Number of decimal digits in n-th Fibonacci number.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18
Offset: 0

Views

Author

Labos Elemer, Apr 03 2001

Keywords

Crossrefs

Programs

  • Haskell
    a060384 = a055642 . a000045  -- Reinhard Zumkeller, Mar 09 2013
  • Maple
    with(combinat): a:=n->nops(convert(fibonacci(n),base,10)): 1,seq(a(n),n=1..100); # Emeric Deutsch, May 19 2007
  • Mathematica
    Table[IntegerLength@ Fibonacci@ n, {n, 0, 84}] /. 0 -> 1 (* or *)
    Table[Floor[n Log10@ GoldenRatio - Log10@ 5/2] + 1, {n, 0, 84}] /. 0 -> 1 (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    print1("1, 1, "); gold=(1+sqrt(5))/2; for(n=2,100,print1(floor((n*log(gold)-log(5)/2)/log(10))+1", ")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), May 01 2007
    
  • PARI
    a(n) = #Str(fibonacci(n)); \\ Michel Marcus, Jul 04 2016
    

Formula

a(n) = floor(n*log(tau)/log(10)) +0 or +1 where tau is the golden ratio. - Benoit Cloitre, Oct 29 2002. [Corrected by Hans J. H. Tuenter, Jul 07 2025].
a(n) = floor(n*log_10(gold) - log_10(5)/2) + 1 for n >= 2, where gold is (1+sqrt(5))/2. - Herman Jamke (hermanjamke(AT)fastmail.fm), May 01 2007
a(n) = A055642(A000045(n)). - Reinhard Zumkeller, Mar 09 2013

Extensions

More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), May 01 2007

A067488 Powers of 2 with initial digit 1.

Original entry on oeis.org

1, 16, 128, 1024, 16384, 131072, 1048576, 16777216, 134217728, 1073741824, 17179869184, 137438953472, 1099511627776, 17592186044416, 140737488355328, 1125899906842624, 18014398509481984, 144115188075855872, 1152921504606846976, 18446744073709551616
Offset: 1

Views

Author

Amarnath Murthy, Feb 09 2002

Keywords

Comments

Also smallest n-digit power of 2.
For each range 10^(n-1) to 10^n-1 there exists exactly 1 power of 2 with first digit 1 (floor(log_10(a(n))) = n-1). As such, the density of this sequence relative to all powers of 2 (A000079) is log(2)/log(10) (0.301..., A007524), which is prototypical of Benford's Law. - Charles L. Hohn, Jul 23 2024

Crossrefs

Programs

Formula

a(n) = 2^ceiling((n-1)*log(10)/log(2)). - Benoit Cloitre, Aug 29 2002
From Charles L. Hohn, Jun 09 2024: (Start)
a(n) = 2^A067497(n-1).
A055642(a(n)) = n. (End)

A045876 Sum of different permutations of digits of n (leading 0's allowed).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 33, 44, 55, 66, 77, 88, 99, 110, 22, 33, 22, 55, 66, 77, 88, 99, 110, 121, 33, 44, 55, 33, 77, 88, 99, 110, 121, 132, 44, 55, 66, 77, 44, 99, 110, 121, 132, 143, 55, 66, 77, 88, 99, 55, 121, 132, 143, 154, 66, 77, 88, 99, 110, 121, 66, 143
Offset: 1

Views

Author

Keywords

Comments

Let the arithmetic mean of the digits of a 'D' digit number n be 'A', let 'N' = number of distinct numbers that can be formed by permuting the digits of n, and let 'I' = concatenation of 1 'D' times = (10^D-1)/9. then a(n) = A*N*I. E.g., let n = 324541, then A = (3+2+4+5+4+1)/6 = 19/6, N = 6!/(2!) = 360, I = 111111, and a(n) = A*N*I = (19/6)*(360)*(111111) = 126666540. - Amarnath Murthy, Jul 14 2003
It seems that the first person who studied the sum of different permutations of digits of a given number was the French scientist Eugène Aristide Marre (1823-1918). See links. - Bernard Schott, Dec 06 2012

References

  • Amarnath Murthy, An interesting result in combinatorics, Mathematics & Informatics Quarterly, Vol. 3, 1999, Bulgaria.

Crossrefs

Same beginning as A033865. Cf. A061147.

Programs

  • Maple
    f:= proc(x) local L,D,n,M,s,j;
      L:= convert(x,base,10);
      D:= [seq(numboccur(j,L),j=0..9)];
      n:= nops(L);
      M:= n!/mul(d!,d=D);
      s:= add(j*D[j+1],j=0..9);
      (10^n-1)*M/9/n*s
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 07 2015
  • Mathematica
    Table[Total[FromDigits /@ Permutations[IntegerDigits[n]]], {n, 100}] (* T. D. Noe, Dec 06 2012 *)
  • PARI
    A047726(n) = n=eval(Vec(Str(n))); (#n)!/prod(i=0, 9, sum(j=1, #n, n[j]==i)!);
    A055642(n) = #Str(n);
    A007953(n) = sumdigits(n);
    a(n) = ((10^A055642(n)-1)/9)*(A047726(n)*A007953(n)/A055642(n)); \\ Altug Alkan, Aug 29 2016
    
  • PARI
    A045876(n) = {my(d=digits(n), q=1, v, t=1); v = vecsort(d); for(i=1, #v-1, if(v[i]==v[i+1], t++, q*=binomial(i, t); t=1)); q*binomial(#v, t)*(10^#d-1)*vecsum(d)/9/#d} \\ David A. Corneth, Oct 06 2016

Formula

a(n) = ((10^A055642(n)-1)/9)*(A047726(n)*A007953(n)/A055642(n)). - Altug Alkan, Aug 29 2016

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

A292730 Numbers in which 0 outnumbers all other digits together.

Original entry on oeis.org

0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10020, 10030, 10040, 10050, 10060, 10070, 10080, 10090, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000
Offset: 1

Views

Author

Halfdan Skjerning, Sep 22 2017

Keywords

Comments

Subset of A292450.
Numbers n such that A055641(n) > (A055642(n)/2). - Felix Fröhlich, Sep 22 2017
Also numbers whose median of the digits is equal to 0. - Stefano Spezia, Oct 04 2023

Examples

			100 has more 0's than any other digit, whereas both 1001 and 1002 have as many other digits as 0's.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 11000], Total@ #1 < First@ #2 & @@ TakeDrop[DigitCount@ #, 9] &] (* Michael De Vlieger, Sep 22 2017 *)
  • PARI
    a055641(n)=if(n, n=digits(n); sum(i=2, #n, n[i]==0), 1) \\ after Charles R Greathouse IV
    is(n) = a055641(n) > (#Str(n)/2) \\ Felix Fröhlich, Sep 22 2017

A054382 James Joyce's "Ulysses" sequence: number of digits in n^(n^n).

Original entry on oeis.org

1, 1, 2, 13, 155, 2185, 36306, 695975, 15151336, 369693100, 10000000001, 297121486765, 9622088391635, 337385711567665, 12735782555419983, 515003176870815368, 22212093154093428530, 1017876887958723919835, 49390464231494436119285
Offset: 0

Views

Author

Antreas P. Hatzipolakis (xpolakis(AT)otenet.gr), May 07 2000

Keywords

Comments

Although Joyce mentions (9^9)^9, he clearly intended to refer to 9^(9^9).
(9^9)^9 is only 196627050475552913618075908526912116283103450944214766927315415537966391196809, whereas 9^(9^9) has 369693100 digits.

Examples

			"Because some years previously in 1886 when occupied with the problem of the quadrature of the circle he had learned of the existence of a number computed to a relative degree of accuracy to be of such magnitude and of so many places, e.g., the 9th power of the 9th power of 9, that, the result having been obtained, 33 closely printed volumes of 1000 pages each of innumerable quires and reams of India paper would have to be requisitioned in order to contain the complete tale of its printed integers of units, tens, hundreds, thousands, tens of thousands, hundreds of thousands, millions, tens of millions, hundreds of millions, billions, the nucleus of the nebula of every digit of every series containing succinctly the potentiality of being raised to the utmost kinetic elaboration of any power of any of its powers." - James Joyce, Ulysses, Chapter 17.
a(2)=2 since 2^(2^2)=2^4=16 has 2 digits. - _Carmine Suriano_, Feb 01 2011
a(0)=1 because 0^(0^0)=0^1=0, which has 1 digit. - _T. D. Noe_, Feb 01 2011
		

References

  • C. A. Laisant (1906) proved that the number of digits of a(9), 9^9^9, is 369693100. H. S. Uhler (1947) published the log of the number to 250 decimal places.
  • David Wells: The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, 1986, p. 208.

Crossrefs

Programs

  • Maple
    A055642 := proc(n) max(1,ilog10(n)+1) ; end proc:
    A054382 := proc(n) A055642(n^(n^n)) ; end proc: # R. J. Mathar, Feb 01 2011
  • Mathematica
    f[ j_ ] := 1 + Floor[ Log[10, j] j^j ]; Table[ f[j], {j, 2, 20} ]

Formula

a(n) = floor(n^n*log_10(n)) + 1 for n > 0. - Jianing Song, Nov 21 2018

Extensions

More terms from Michael Kleber, May 07 2000
Previous Showing 61-70 of 506 results. Next