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 #11 Mar 13 2020 10:42:15
%S 1,1,3,1,4,1,5,3,6,1,7,1,7,6,5,1,7,1,5,4,7,1,7,6,4,9,8,1,7,1,9,8,7,6,
%T 5,1,8,7,6,1,7,1,11,10,9,1,9,8,7,10,9,1,7,6,5,7,13,1,11,1,9,8,7,8,7,1,
%U 13,12,11,1,9,1,7,6,8,8,7,1,11,10,9,1,7,6,11,10,9,1,11
%N Least k > 0 such that (k!+n!)/(k+n) is an integer.
%C a(n) = 1 iff n+1 is prime.
%H Harvey P. Dale, <a href="/A242746/b242746.txt">Table of n, a(n) for n = 1..1000</a>
%e (1!+3!)/(1+3) = 7/4 is not an integer. (2!+3!)/(2+3) = 8/5 is not an integer. (3!+3!)/(3+3) = 12/6 = 2 is an integer. Thus a(3) = 3.
%t lnk[n_]:=Module[{k=1,nf=n!},While[!IntegerQ[(k!+nf)/(k+n)],k++];k]; Array[ lnk,90] (* _Harvey P. Dale_, Sep 26 2014 *)
%o (PARI) a(n) = for(k=1, oo, if((k!+n!)%(k+n)==0, return(k))); \\ Modified by _Jinyuan Wang_, Mar 13 2020
%K nonn
%O 1,3
%A _Derek Orr_, May 21 2014