OFFSET
3,1
COMMENTS
LINKS
Daniel Forgues, Table of n, a(n) for n = 3..100000
FORMULA
a(n) = n + 1 - Sum_{k=1..n}( floor(k!^(n-1)/(n-1)!)-floor((k!^(n-1)-1)/(n-1)!) ). - Anthony Browne, May 17 2016
a(n) = A060265(floor(n/2)) for n >= 4. - Georg Fischer, Nov 29 2022
MATHEMATICA
Table[NextPrime[n, -1], {n, 3, 77}] (* Jean-François Alcover, May 27 2011 *)
PROG
(Maxima) makelist(prev_prime(n), n, 3, 79); /* Bruno Berselli, May 20 2011 */
(Haskell)
a151799 = a007917 . (subtract 1) -- Reinhard Zumkeller, Jul 26 2012
(PARI) a(n)=precprime(n-1) \\ Charles R Greathouse IV, Jul 12 2016
(Python)
from sympy import prevprime
def A151799(n):
return prevprime(n) # Chai Wah Wu, Feb 28 2018
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Jun 29 2009
STATUS
approved