OFFSET
3,1
COMMENTS
a(n) is the smallest divisor of n which is greater than A055874(n).
a(n) is also the smallest divisor m, m > 1, of n where m - 1 is not a divisor of n.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 3..10000
FORMULA
a(n) = n if n is an odd prime or if n = 4 or 6. - Alonso del Arte, Aug 07 2014
EXAMPLE
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.
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.
MAPLE
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
MATHEMATICA
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 *)
Array[#[[1 + LengthWhile[Prepend[Differences@ #, 1], # == 1 &] ]] &@ Divisors@ # &, 78, 3] (* Michael De Vlieger, Oct 10 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 21 2007
EXTENSIONS
More terms from R. J. Mathar, Nov 01 2007
STATUS
approved