This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A082120 #12 Aug 12 2015 17:16:28 %S A082120 2,3,4,5,6,2,8,3,10,4,12,5,2,6,16,3,18,8,4,9,22,2,24,11,6,3,28,7,30,4, %T A082120 8,15,2,5,36,17,10,3,40,11,42,7,4,21,46,2,48,5,14,9,52,3,6,10,16,27, %U A082120 58,4,60,29,2,12,8,5,66,13,20,3,70,6,72,35,10,15,4,7,78,2,24,39,82,5 %N A082120 Smallest difference > 1 between d and n/d for any divisor d of n. %C A082120 a(p) = p-1 for prime p. %H A082120 Robert Israel, <a href="/A082120/b082120.txt">Table of n, a(n) for n = 3..10000</a> %p A082120 F:= proc(n) local p; %p A082120 p:= min(select(t -> t - n/t > 1, numtheory:-divisors(n))); %p A082120 p - n/p %p A082120 end proc: %p A082120 map(F, [$3..100]); # _Robert Israel_, Aug 12 2015 %t A082120 sd[n_]:=Min[Select[Abs[#-n/#]&/@Divisors[n],#>1&]]; Array[sd,90,3] (* _Harvey P. Dale_, Sep 28 2013 *) %o A082120 (PARI) for(n=3, 100, v=divisors(n); r=sqrt(n); t=0; for(k=1, length(v), if(v[k]>=r, t=k; break)); if(v[t]^2==n, u=t, u=t-1); if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", ")) %Y A082120 Cf. A082119, A056737, A003681, A082121. %K A082120 nonn,easy %O A082120 3,1 %A A082120 _Ralf Stephan_, Apr 04 2003