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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A275272 a(n) = p - n!, where p is the second smallest prime > n!. 5
2, 3, 5, 7, 11, 13, 19, 31, 23, 19, 17, 43, 73, 41, 149, 41, 53, 61, 109, 37, 37, 71, 109, 193, 97, 173, 47, 101, 229, 163, 241, 83, 139, 103, 83, 577, 311, 47, 269, 61, 61, 107, 97, 89, 379, 149, 269, 83, 137, 167, 281, 89, 79, 443, 229, 157, 179, 563, 389 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

p-n! where p = nextprime(nextprime(n!)).

Is every term a prime?

LINKS

Clark Kimberling, Table of n, a(n) for n = 1..300

FORMULA

a(n) = A187874(n) - A000142(n). - Michel Marcus, Mar 05 2022

EXAMPLE

For n = 4, we have n! = 24, so that p = 31 and a(4) = 7.

MATHEMATICA

Table[NextPrime[n!, 2] - n!, {n, 1, 150}]

PROG

(PARI) a(n) = nextprime(nextprime(n!+1)+1) - n!; \\ Michel Marcus, Mar 05 2022

(Python)

from sympy import factorial, nextprime

def a(n): fn = factorial(n); return nextprime(nextprime(fn)) - fn

print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 05 2022

CROSSREFS

Cf. A037153, A005235, A275273, A275274, A000040.

Cf. A000142, A187874.

Sequence in context: A242738 A079153 A020616 * A329954 A338396 A067910

Adjacent sequences: A275269 A275270 A275271 * A275273 A275274 A275275

KEYWORD

nonn,easy

AUTHOR

Clark Kimberling, Jul 23 2016

STATUS

approved

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 December 6 01:03 EST 2022. Contains 358594 sequences. (Running on oeis4.)