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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Mar 17 2019 03:45:42
%S 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,
%T 19,17,13,11,7,593,589,583,581,571,569,563,557,553,547,541,539,529,
%U 527,523,521,509,497,493,491,487,481,479,469,463,457,451,449,443,439,437
%N a(n) = k! - prime(n) where k is the smallest number for which prime(n) <= k!.
%C How many times does each prime number appear in this sequence?
%C Are there infinitely many solutions of the form
%C (k!-p(n)) = p(r_1)*...*p(r_i); r_i < n for all i?
%F a(n) = A048765(prime(n)) - prime(n). - _R. J. Mathar_, Aug 25 2010
%e a(1) = 2! - p(1) = 2 - 2 = 0;
%e a(2) = 3! - p(2) = 6 - 3 = 3;
%e a(3) = 3! - p(3) = 6 - 5 = 1;
%e a(4) = 4! - p(4) = 24 - 7 = 17;
%e a(5) = 4! - p(5) = 24 - 11 = 13;
%e a(6) = 4! - p(6) = 24 - 13 = 11;
%e a(7) = 4! - p(7) = 24 - 17 = 7;
%e a(8) = 4! - p(8) = 24 - 19 = 5;
%e a(9) = 4! - p(9) = 24 - 23 = 1;
%e a(10) = 5! - p(10) = 120 - 29 = 91;
%e etc.
%p A048765 := proc(n) for i from 1 do if i! >= n then return i! ; end if; end do: end proc:
%p A151918 := proc(n) p := ithprime(n) ; A048765(p)-p ; end proc:
%p seq(A151918(n),n=1..80) ; # _R. J. Mathar_, Aug 25 2010
%t 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 *)
%Y Cf. A000040, A000142.
%K easy,nonn
%O 0,2
%A _Ctibor O. Zizka_, Apr 06 2008
%E More terms from _R. J. Mathar_, Aug 25 2010