P12225 link reply
Observe that

[tex: (2 − 1)! + 1 = 2^1],
[tex: (3 − 1)! + 1 = 3^1],
[tex: (5 − 1)! + 1 = 5^2].

Are there any other primes p such that (p − 1)! + 1 is a power of p?
P12234 link reply
The only natural numbers with this property up to 10000 are 2, 3 and 5. I was too lazy to only test primes.

[code]
(define (logt x b)
(/ (log x) (log b)))

(define (! n)
(let loop ((n n) (acc 1))
(if (= n 0)
acc
(loop (- n 1) (* acc n)))))

(define (range a b)
(let loop ((b b) (acc '()))
(if (> a b)
acc
(loop (- b 1) (cons b acc)))))

(define err 1.0e-10)

(define (test a b)
(filter (lambda (entry)
(< (abs (- (cadr entry) (round (cadr entry)))) err))
(map (lambda (n)
(list n (logt (+ (! (- n 1)) 1) n)))
(range a b))))

(display (test 1 10000))
(newline)
[/code]

Output:
[code]
((2 1.0) (3 1.0) (5 2.0))
[/code]
P12286 link reply
At the very least, for p>3, the exponent has to be even.
P12304 link reply
We can prove fairly easily that composite numbers can't have this property. If n is a composite number, there is some prime number p less than n which divides n. Since (n-1)! is a multiple of p, (n-1)! + 1 cannot be a multiple of p, which means it cannot be a power of n.
x