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