All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
One and only (Posted on 2016-04-28) Difficulty: 2 of 5
There is only one prime p such that p! is p digits long.

Find it and prove its uniqueness.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer assisted solution | Comment 3 of 4 |
prime  length of                    factorial
       factorial
   2     1                                                   2 
   3     1                                                   6
   5     3                                                 120
   7     4                                                5040
  11     8                                            39916800
  13    10                                          6227020800
  17    15                                     355687428096000
  19    18                                  121645100408832000
  23    23                             25852016738884976640000
  29    31                     8841761993739701954543616000000
  31    34                  8222838654177922817725562880000000
  37    44        13763753091226345046315979581580902400000000
  41    50  33452526613163807108170062053440751665152000000000 
  43    53
  47    60
  53    70
  59    81
  61    84
  67    95
  71   102
  73   106
  79   117
  83   125
  89   137
  97   152
 101   160 
 
The only match on the table is for p=23, which has a 23-digit factorial.

After 100, each successive factorial's length goes up by at least 2 for every increase of the number by 1, so no numbers, prime or not, beyond 100 will have a factorial whose length matches the number.

More fundamentally, now that I think about it, even after 29, each successive number's factorial's length increased by at least 1, and the factorial's length was already greater than the number itself -- no need to go all the way to over 100.

In fact, only 1, 22, 23 and 24 have the property that each one's factorial's length is equal to the number itself.  Of these, only 23 is prime.
 
Table generated by: 
 
    5   open "1andonly.txt" for output as #2
   10   repeat
   20    P=nxtprm(P)
   30    Pf=!(P)
   40    Ps$=cutspc(str(Pf))
   50    L=len(Ps$)
   60    print #2,P,L
   70   until P>100
   80   close #2

supplemented by a variation also printing Pf, the actual factorial.

  Posted by Charlie on 2016-04-28 10:34:13
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information