# 【数学题】SHLQSH数

SHLQSH数

问题描述：

2 6

13

样例说明：(说明部分不必输出)

2的约数有1,2 (2个)；

3的约数有1,3 (2个)；

4的约数有1,2,4 (3个)；

5的约数有1,5 (2个)；

6的约数有1,2,3,6 (4个)。

【数据规模】

对于50 %的数据,保证有t1,t2<=5000000

对于全部的数据,保证有t1,t2<=10000000

======================================

..果然...

========================

var
t1,t2:longint;
procedure init;
begin
assign(input,'shlqsh.in');
assign(output,'shlqsh.out');
reset(input); rewrite(output);
end;

procedure terminate;
begin
close(input); close(output);
halt;
end;

procedure main;
var
i,j:longint;
ans:longint;
t:longint;
begin
ans:=0;
for i:=1 to t2 do
ans:=ans+t2 div i;
for i:=1 to t1-1 do
ans:=ans-(t1-1) div i;
writeln(ans);
end;

begin
init;
main;
terminate;
end.


=======================================

====

const
biao:array[0..100]of longint=
(0,1166750,2472113,3829833,5221472,6638449,8075504,
9529316,10997454,12478206,13970034,15471834,
16982741,18502034,20029013,21563172,23103918,
24650975,26203975,27762428,29326296,30895025,
32468539,34046648,35629007,37215589,38806214,
40400725,41998809,43600482,45205760,46814198,
48425926,50040880,51658667,53279454,54903203,
56529611,58158815,59790632,61425110,63061872,
64701179,66342791,67986865,69633203,71281688,
72932251,74585102,76240071,77896938,79555864,
81216802,82879546,84544347,86210861,87879246,
89549371,91221198,92894942,94570325,96247243,
97925867,99606221,101287993,102971423,104656393,
106342746,108030713,109720250,111411029,113103244,
114797007,116492131,118188494,119886288,121585508,
123285988,124987758,126690768,128395238,130100774,
131807479,133515444,135224718,136935081,138646648,
140359419,142073346,143788415,145504640,147221752,
148940245,150659679,152380115,154101766,155824418,
157548020,159272878,160998658,162725364);
procedure init;
begin
assign(input,'shlqsh.in');
assign(output,'shlqsh.out');
reset(input); rewrite(output);
end;

procedure terminate;
begin
close(input); close(output);
halt;
end;

function calc(x:longint):longint;
var
i,j:longint;
t:longint;
begin
calc:=0;
for i:=(x div 100000)*100000+1 to x do
begin
t:=0;
for j:=1 to trunc(sqrt(i)) do
begin
if i mod j=0 then inc(t);
end;
if trunc(sqrt(i))*trunc(sqrt(i))=i then calc:=calc+t*2-1
else calc:=calc+t*2;
end;
end;

procedure main;
var
a,b:longint;
ans1,ans2:longint;
i:longint;
begin
ans1:=biao[(a-1)div 100000]+calc(a-1);
ans2:=biao[b div 100000]+calc(b);
writeln(ans2-ans1);
end;

begin
init;
main;
terminate;
end.