cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

0, 3, 1, 17, 13, 11, 7, 5, 1, 91, 89, 83, 79, 77, 73, 67, 61, 59, 53, 49, 47, 41, 37, 31, 23, 19, 17, 13, 11, 7, 593, 589, 583, 581, 571, 569, 563, 557, 553, 547, 541, 539, 529, 527, 523, 521, 509, 497, 493, 491, 487, 481, 479, 469, 463, 457, 451, 449, 443, 439, 437
Offset: 0

Views

Author

Ctibor O. Zizka, Apr 06 2008

Keywords

Comments

How many times does each prime number appear in this sequence?
Are there infinitely many solutions of the form
(k!-p(n)) = p(r_1)*...*p(r_i); r_i < n for all i?

Examples

			a(1)  = 2! - p(1)  =   2 -  2 =  0;
a(2)  = 3! - p(2)  =   6 -  3 =  3;
a(3)  = 3! - p(3)  =   6 -  5 =  1;
a(4)  = 4! - p(4)  =  24 -  7 = 17;
a(5)  = 4! - p(5)  =  24 - 11 = 13;
a(6)  = 4! - p(6)  =  24 - 13 = 11;
a(7)  = 4! - p(7)  =  24 - 17 =  7;
a(8)  = 4! - p(8)  =  24 - 19 =  5;
a(9)  = 4! - p(9)  =  24 - 23 =  1;
a(10) = 5! - p(10) = 120 - 29 = 91;
etc.
		

Crossrefs

Programs

  • Maple
    A048765 := proc(n) for i from 1 do if i! >= n then return i! ; end if; end do: end proc:
    A151918 := proc(n) p := ithprime(n) ; A048765(p)-p ; end proc:
    seq(A151918(n),n=1..80) ; # R. J. Mathar, Aug 25 2010
  • Mathematica
    Module[{fs=Range[10]!,p},Join[{0},Flatten[Table[p=Prime[n];Select[ fs,#>p&,1]-p,{n,2,70}]]]] (* Harvey P. Dale, Oct 04 2013 *)

Formula

a(n) = A048765(prime(n)) - prime(n). - R. J. Mathar, Aug 25 2010

Extensions

More terms from R. J. Mathar, Aug 25 2010