login
Smallest divisor of n which is greater than largest divisor d of n such that each integer from 1 to d is also a divisor of n.
3

%I #22 Oct 11 2017 09:17:28

%S 3,4,5,6,7,4,3,5,11,6,13,7,3,4,17,6,19,4,3,11,23,6,5,13,3,4,29,5,31,4,

%T 3,17,5,6,37,19,3,4,41,6,43,4,3,23,47,6,7,5,3,4,53,6,5,4,3,29,59,10,

%U 61,31,3,4,5,6,67,4,3,5,71,6,73,37,3,4,7,6,79,4

%N Smallest divisor of n which is greater than largest divisor d of n such that each integer from 1 to d is also a divisor of n.

%C a(n) is the smallest divisor of n which is greater than A055874(n).

%C a(n) is also the smallest divisor m, m > 1, of n where m - 1 is not a divisor of n.

%H Michael De Vlieger, <a href="/A126800/b126800.txt">Table of n, a(n) for n = 3..10000</a>

%F a(n) = n if n is an odd prime or if n = 4 or 6. - _Alonso del Arte_, Aug 07 2014

%e The divisors of 12 are 1, 2, 3, 4, 6, 12. The first four divisors are the first four positive integers, but 5 is not a divisor of 12, and the smallest divisor greater than 5 is 6, so a(12) = 6.

%e The divisors of 14 are 1, 2, 7, 14. The first two divisors are the first two positive integers, but 3 is not a divisor of 14, and the smallest divisor greater than 3 is 7, so a(14) = 7.

%p A055874 := proc(n) local m; for m from 1 do if n mod m <> 0 then RETURN(m-1) ; fi ; od: end: A126800 := proc(n) local a; for a from A055874(n)+1 do if n mod a = 0 then RETURN(a) ; fi ; od: end: seq(A126800(n),n=3..80) ; # _R. J. Mathar_, Nov 01 2007

%t sdn[n_]:=Module[{divs=Divisors[n],s,c},s=First[Split[Differences[divs]]];c=Length[s]+1;Which[PrimeQ[n],n,First[s]>1,divs[[2]],True,First[Drop[ divs,c]]]];Array[sdn,80,3] (* _Harvey P. Dale_, Jan 18 2015 *)

%t Array[#[[1 + LengthWhile[Prepend[Differences@ #, 1], # == 1 &] ]] &@ Divisors@ # &, 78, 3] (* _Michael De Vlieger_, Oct 10 2017 *)

%Y Cf. A055874.

%K nonn

%O 3,1

%A _Leroy Quet_, Feb 21 2007

%E More terms from _R. J. Mathar_, Nov 01 2007