login
Consider all the integers k where the n-th prime <= k <= the (n+1)th prime. a(n) is the largest integer that divides at least two of the integers k.
2

%I #13 Oct 03 2015 23:54:31

%S 1,1,1,2,1,2,1,2,4,1,4,2,1,2,4,3,1,3,2,1,3,2,4,6,2,1,2,1,2,9,2,4,1,7,

%T 1,4,3,2,4,3,1,7,1,2,1,10,6,2,1,2,3,1,5,4,3,4,1,4,2,1,5,9,2,1,2,11,4,

%U 5,1,2,3,6,4,3,2,4,6,2,6,5,1,5,1,3,2,4,6,2,1,2,9,6,2,6,2,4,10,1,15,3,5,3,4

%N Consider all the integers k where the n-th prime <= k <= the (n+1)th prime. a(n) is the largest integer that divides at least two of the integers k.

%H Harvey P. Dale, <a href="/A140715/b140715.txt">Table of n, a(n) for n = 1..1000</a>

%e The 18th prime is 61 and the 19th prime is 67. So we will consider the integers 61, 62, 63, 64, 65, 66, 67. No integer >= 7 divides more than one integer in this range, because the range consists only of 7 terms, the two on the end being prime. Checking: 6 divides 66, but does not divide any other integer in this range. 5 divides 65, but does not divide any other integer in this range. 4 divides 64, but nothing else. 3, on the other hand, divides both 63 and 66. So a(18) = 3.

%p nodvs := proc(n,L) local a,l ; a := 0 ; for l in L do if l mod n = 0 then a := a+1 ; fi: od: RETURN(a) ; end: A140715 := proc(n) local k,a ; k := [seq(i,i=ithprime(n)..ithprime(n+1))] ; for a from op(-1,k) by -1 do if nodvs(a,k) >= 2 then RETURN(a) ; fi; od: end: for n from 1 to 160 do printf("%d,",A140715(n)) ; od: # _R. J. Mathar_, Aug 08 2008

%t lid2[{a_,b_}]:=Module[{r=Range[a,b]},Select[Table[{n,Count[r/n,_?IntegerQ]},{n,Length[r],1,-1}],#[[2]]>1&,1][[1,1]]]; lid2/@Partition[Prime[ Range[ 110]],2,1] (* _Harvey P. Dale_, Jun 07 2013 *)

%K nonn

%O 1,4

%A _Leroy Quet_, Jul 11 2008

%E Extended beyond a(18) by _R. J. Mathar_, Aug 08 2008