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 A241424 #20 Jul 27 2020 04:44:58 %S A241424 0,0,1,2,2,1,2,3,3,0,3,1,3,1,2,0,3,1,3,1,2,0,3,1,3,4,4,0,4,1,4,1,2,0, %T A241424 4,0,4,1,2,0,4,1,4,1,2,0,4,1,3,0,0,0,4,1,4,0,0,0,3,1,4,1,2,0,4,0,4,1, %U A241424 2,0,4,1,3,1,2,0,4,0,3,1,2,0,4,1,4,0,0,0,3,1,4,0,0,0,4 %N A241424 Largest number k > 0 such that n - k! is prime, or 0 if no such k exists. %C A241424 If k > n, n - k! is negative and therefore, not prime. %H A241424 Robert Israel, <a href="/A241424/b241424.txt">Table of n, a(n) for n = 1..10000</a> %p A241424 a:= proc(n) local k, r; %p A241424 r:= 0; %p A241424 for k from 1 do %p A241424 if k! >= n then return r %p A241424 elif isprime(n-k!) then r:= k %p A241424 fi %p A241424 od %p A241424 end proc: %p A241424 seq(a(n),n=1..100); # _Robert Israel_, Aug 10 2014 %t A241424 a[n_] := Module[{k, r = 0}, For[k = 1, True, k++, If[k! >= n, Return[r], If[PrimeQ[n - k!], r = k]]]]; %t A241424 Array[a, 100] (* _Jean-François Alcover_, Jul 27 2020, after Maple *) %o A241424 (PARI) %o A241424 a(n)=forstep(k=n,1,-1,if(ispseudoprime(n-k!),return(k))) %o A241424 n=1;while(n<150,print1(a(n),", ");n++) %Y A241424 Cf. A175940, A245715. %K A241424 nonn %O A241424 1,4 %A A241424 _Derek Orr_, Aug 08 2014