login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A136437 a(n) = prime(n) - k! where k is the greatest number such that k! <= prime(n). 7
0, 1, 3, 1, 5, 7, 11, 13, 17, 5, 7, 13, 17, 19, 23, 29, 35, 37, 43, 47, 49, 55, 59, 65, 73, 77, 79, 83, 85, 89, 7, 11, 17, 19, 29, 31, 37, 43, 47, 53, 59, 61, 71, 73, 77, 79, 91, 103, 107, 109, 113, 119, 121, 131, 137, 143, 149, 151, 157, 161, 163, 173, 187, 191, 193, 197, 211, 217, 227, 229, 233, 239, 247 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

How many times does each prime appear in this sequence?

The only value (prime(n) - k!) = 0 is at n=1, where k=2.

Are n=2, k=2 and n=4, k=3 the only occurrences of (prime(n) - k!) = 1?

There exist infinitely many solutions of the form (prime(n) - k!) = prime(n-t), t < n.

Are there infinitely many solutions of the form (prime(n) - k!) = prime(r_1)*...*prime(r_i); r_i < n for all i?

LINKS

Jinyuan Wang, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = prime(n)- k! where k is the greatest number for which k! <= prime(n).

a(n) = A212598(prime(n)). - Michel Marcus, Feb 19 2019

EXAMPLE

a(1)  = prime(1)  - 2! =  2 -  2 =  0;

a(2)  = prime(2)  - 2! =  3 -  2 =  1;

a(3)  = prime(3)  - 2! =  5 -  2 =  3;

a(4)  = prime(4)  - 3! =  7 -  6 =  1;

a(5)  = prime(5)  - 3! = 11 -  6 =  5;

a(6)  = prime(6)  - 3! = 13 -  6 =  7;

a(7)  = prime(7)  - 3! = 17 -  6 = 11;

a(8)  = prime(8)  - 3! = 19 -  6 = 13;

a(9)  = prime(9)  - 3! = 23 -  6 = 17;

a(10) = prime(10) - 4! = 29 - 24 =  5.

MAPLE

f:=proc(n) local p, i; p:=ithprime(n); for i from 0 to p do if i! > p then break; fi; od; p-(i-1)!; end;

[seq(f(n), n=1..70)]; # N. J. A. Sloane, May 22 2012

PROG

(PARI) a(n) = my(k=1, p=prime(n)); while (k! <= p, k++); p - (k-1)!; \\ Michel Marcus, Feb 19 2019

CROSSREFS

Cf. A135996, A000040, A000142, A212598, A212266.

Sequence in context: A159285 A021080 A049764 * A137328 A140991 A302191

Adjacent sequences:  A136434 A136435 A136436 * A136438 A136439 A136440

KEYWORD

easy,nonn

AUTHOR

Ctibor O. Zizka, Apr 02 2008

EXTENSIONS

More terms from Jinyuan Wang, Feb 18 2019

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 17 04:03 EDT 2019. Contains 327119 sequences. (Running on oeis4.)