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.

A034886 Number of digits in n!.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 19, 20, 22, 23, 24, 26, 27, 29, 30, 31, 33, 34, 36, 37, 39, 41, 42, 44, 45, 47, 48, 50, 52, 53, 55, 57, 58, 60, 62, 63, 65, 67, 68, 70, 72, 74, 75, 77, 79, 81, 82, 84, 86, 88, 90, 91, 93, 95, 97, 99, 101, 102
Offset: 0

Views

Author

Keywords

Comments

Most counterexamples to the Kamenetsky formula (see below) must belong to A177901.
Noam D. Elkies reported on MathOverflow (see link):
"A counterexample [to Kamenetsky's formula] is n_1 := 6561101970383, with log_10((n_1/e)^n_1*sqrt(2*Pi*n_1)) = 81244041273652.999999999999995102482, but log_10(n_1!) = 81244041273653.000000000000000618508. [...] n_1 is the first counterexample, and the only one up to 10^14."
From Bernard Schott, Dec 07 2019: (Start)
a(n) < n iff 2 <= n <= 21;
a(n) = n iff n = 1, 22, 23, 24;
a(n) > n iff n = 0 or n >= 25. (End)

References

  • Martin Gardner, "Factorial Oddities." Ch. 4 in Mathematical Magic Show: More Puzzles, Games, Diversions, Illusions and Other Mathematical Sleight-of-Mind from Scientific American. New York: Vintage, pp. 50-65, 1978

Crossrefs

Cf. A006488 (a(n) is a square), A056851 (a(n) is a cube), A035065 (a(n) is a prime), A333431 (a(n) is a factorial), A333598 (a(n) is a palindrome), A067367 (p and a(p) are primes), A058814 (n divides a(n)).
Cf. A137580 (number of distinct digits in n!), A027868 (number of trailing zeros in n!).

Programs

  • Haskell
    a034886 = a055642 . a000142  -- Reinhard Zumkeller, Apr 08 2012
    
  • Magma
    [Floor(Log(Factorial(n))/Log(10)) + 1: n in [0..30]]; // G. C. Greubel, Feb 26 2018
  • Maple
    A034886 := n -> `if`(n<2,1,`if`(n<6561101970383, ceil((ln(2*Pi)-2*n+ln(n)*(1+2*n))/(2*ln(10))),length(n!))); # Peter Luschny, Aug 26 2011
  • Mathematica
    Join[{1, 1}, Table[Ceiling[Log[10, 2 Pi n]/2 + n*Log[10, n/E]], {n, 2, 71}]]
    f[n_] := Floor[(Log[2Pi] - 2n + Log[n]*(1 + 2n))/(2Log[10])] + 1; f[0] = f[1] = 1; Array[f, 72, 0] (* Robert G. Wilson v, Jan 09 2013 *)
    IntegerLength/@(Range[0,80]!) (* Harvey P. Dale, Aug 07 2022 *)
  • PARI
    for(n=0,30, print1(floor(log(n!)/log(10)) + 1, ", ")) \\ G. C. Greubel, Feb 26 2018
    

Formula

a(n) = floor(log(n!)/log(10)) + 1.
a(n) = A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n); a(n) = A055642(A000142(n)). - Reinhard Zumkeller, Jan 27 2008
Using Stirling's formula we can derive an approximation, which is very fast to compute in practice: ceiling(log_10(2*Pi*n)/2 + n*(log_10(n/e))). This approximation gives the exact answer for 2 <= n <= 5*10^7. - Dmitry Kamenetsky, Jul 07 2008
a(n) = ceiling(log_10(1) + log_10(2) + ... + log_10(n)). - Dmitry Kamenetsky, Nov 05 2010

Extensions

Explained that the formula is an approximation. Made the formula easier to read. - Dmitry Kamenetsky, Dec 15 2010

A056851 Integers n such that the number of digits in n! is a cube.

Original entry on oeis.org

0, 1, 2, 3, 11, 26, 83, 128, 186, 258, 572, 875, 1494, 2029, 3859, 4810, 6497, 9274, 18033, 19243, 24600, 26073, 30828, 32528, 34287, 41930, 48325, 96475, 103590, 118814, 126936, 205022, 240742, 260009, 331334, 379612, 396656, 405360, 414186
Offset: 1

Views

Author

Robert G. Wilson v, Aug 30 2000

Keywords

Comments

Numbers whose cube is represented by the number of digits of n!: 1, 2, 3, 5, 6, 7, 8, 11, 13, 16, 18, 23, 25, 28, ..., . - Robert G. Wilson v, May 14 2014
Ed Pegg Jr conjectures that n^3 - n = k! has a solution if and only if n is 2, 3, 5 or 9 (when k is 3, 4, 5 and 6).

Crossrefs

Programs

  • Mathematica
    Do[ If[ IntegerQ[ RealDigits[ n! ][[ 2 ]]^(1/3) ], Print[ n ]], {n, 0, 53100}]
    LogBase10Stirling[n_] := Floor[Log[10, 2 Pi n]/2 + n*Log[10, n/E] + Log[10, 1 + 1/(12n) + 1/(288n^2) - 139/(51840n^3) - 571/(2488320n^4) + 163879/(209018880n^5)]]; Select[ Range[ 500000], IntegerQ[ (LogBase10Stirling[ # ] + 1)^(1/3)] & ]
    Select[Range[0,420000],IntegerQ[Surd[IntegerLength[#!],3]]&] (* Harvey P. Dale, Mar 09 2019 *)

Formula

{n: A034886(n) in A000578}. - R. J. Mathar, Jan 15 2013

Extensions

More terms from Robert G. Wilson v, Jun 25 2003

A333598 Numbers m such that m! has a palindromic number of decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 22, 30, 37, 44, 57, 63, 69, 70, 81, 86, 91, 106, 111, 116, 126, 131, 140, 145, 154, 163, 168, 177, 186, 199, 221, 225, 238, 242, 255, 259, 288, 292, 368, 372, 384, 388, 407, 411, 419, 423, 438, 450, 532
Offset: 1

Views

Author

Bernard Schott, Mar 28 2020

Keywords

Comments

The corresponding palindromic numbers are 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 77, 88, 99, 101, ...
Nice result: 22 is a palindrome and 22! has 22 digits, and also, 44! has 55 digits.

Examples

			14! = 87178291200 that has 11 digits, 11 is a palindrome, hence 14 is a term.
		

Crossrefs

Cf. A006488 (similar, with square), A035065 (similar, with prime), A056851 (similar, with cube), A333431 (similar, with factorial).

Programs

  • Mathematica
    Select[Range[0, 532], PalindromeQ @ Length @ IntegerDigits[#!] &] (* Amiram Eldar, Mar 28 2020 *)
    Select[Range[0,550],PalindromeQ[IntegerLength[#!]]&] (* Harvey P. Dale, Oct 30 2023 *)
  • PARI
    isok(m) = my(d=digits(#Str(m!))); d == Vecrev(d); \\ Michel Marcus, Mar 28 2020

A094873 n! has a triangular number of digits.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 9, 13, 17, 32, 38, 44, 65, 106, 125, 135, 156, 178, 201, 213, 278, 292, 306, 335, 350, 381, 413, 446, 463, 480, 570, 589, 608, 647, 667, 687, 728, 749, 770, 880, 996, 1020, 1044, 1169, 1247, 1300, 1327, 1354, 1437, 1551, 1669, 1699, 1760
Offset: 0

Views

Author

Jason Earls, Jun 16 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[0,1800],OddQ[Sqrt[1+8 IntegerLength[#!]]]&] (* Harvey P. Dale, Aug 07 2023 *)

Formula

{n: A034886(n) in A000217}. - R. J. Mathar, Nov 15 2019
Showing 1-4 of 4 results.