login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A037155 a(n) = n!-p, where p is the largest prime < (n!-1). 6

%I #30 May 22 2022 14:31:13

%S 3,5,7,11,17,31,13,11,13,13,23,17,47,53,59,41,101,31,31,73,89,73,149,

%T 37,43,101,31,79,61,163,47,193,113,127,97,79,73,83,131,79,109,109,53,

%U 89,79,103,59,97,179,67,59,127,61,461,277,109,137,139,71,71,101,359

%N a(n) = n!-p, where p is the largest prime < (n!-1).

%C Analogous to the lesser Fortunate numbers and like them, all entries so far are primes.

%H Charles R Greathouse IV, <a href="/A037155/b037155.txt">Table of n, a(n) for n = 3..1000</a>

%H Antonín Čejchan, Michal Křížek, and Lawrence Somer, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL25/Krizek/krizek3.html">On Remarkable Properties of Primes Near Factorials and Primorials</a>, Journal of Integer Sequences, Vol. 25 (2022), Article 22.1.4.

%F a(n) >= n. - _Seiichi Manyama_, Mar 21 2018

%e a(4) = 4!-19 = 24-19 = 5.

%t PrevPrime[ n_Integer ] := (k=n-1; While[ !PrimeQ[ k ], k-- ]; Return[ k ]); f[ n_Integer ] := (p = n! - 1; q = NextPrime[ p ]; Return[ p - q + 1 ]); Table[ f[ n ], {n, 3, 75} ]

%t f[n_]:=Module[{nf=n!},nf-NextPrime[nf-1,-1]];f/@Range[3,90] (* _Harvey P. Dale_, Mar 20 2011 *)

%o (PARI) a(n)=my(N=n!); N-precprime(N-3) \\ _Charles R Greathouse IV_, Jan 28 2018

%o (Python)

%o from sympy import factorial, prevprime

%o def a(n): fn = factorial(n); return fn - prevprime(fn-1)

%o print([a(n) for n in range(3, 65)]) # _Michael S. Branicky_, May 22 2022

%Y Cf. A055211.

%K nonn

%O 3,1

%A _Jud McCranie_

%E More terms from _James A. Sellers_, Jul 06 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 03:46 EDT 2024. Contains 371782 sequences. (Running on oeis4.)