login
A140715
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
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, 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, 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
OFFSET
1,4
LINKS
EXAMPLE
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.
MAPLE
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
MATHEMATICA
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 *)
CROSSREFS
Sequence in context: A347224 A339270 A345226 * A330690 A263143 A197945
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 11 2008
EXTENSIONS
Extended beyond a(18) by R. J. Mathar, Aug 08 2008
STATUS
approved