Problem:
 Score : 300 points    Problem Statement Given is a positive integer N .
How many tuples (A,B,C) of positive integers satisfy A \times B + C = N ?      Constraints  2 \leq N \leq 10^6  All values in input are integers.         Input Input is given from Standard Input in the following format:  N       Output Print the answer.        Sample Input 1 3      Sample Output 1 3  There are 3 tuples of integers that satisfy A \times B + C = 3 : (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1) .       Sample Input 2 100      Sample Output 2 473       Sample Input 3 1000000      Sample Output 3 13969985

Solution (Python):
N = int(input())

ans = 0
for i in range(1, N - 1):
    ans += N // i
    if N % i == 0:
        ans -= 1

print(ans + 1)

Solution (Python):
def cnt(A, N):
    t = N // A
    if N % A == 0:
        return t - 1
    else:
        return t

N = int(input())
s = 0
for i in range(1, N):
    s += cnt(i, N)

print(s)

Solution (Python):

n = int(input())
res=0
for i in range(1,n-1):
    res+=(n-1)//i
print(res+1)

Solution (Python):
n = int(input())
lim = n
count = 0
for b in range(1,lim):
    add = int((n-1)/b)
    count += add
print(count)

Solution (Python):
N=int(input())

ans=0

for i in range(1,N):
    a = N//i
    
    if a!=N/i:
        ans+=a
    else:ans+=a-1

print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n,1):
    ans += (n-1)//i

print(ans)

Solution (Python):
N = int(input())
memo = [1]*(N)
memo[0] = 0
ans = 0
for i in range(2,N):
    tmp = i
    while tmp < N:
        memo[tmp] += 1
        tmp += i
print(sum(memo))

Solution (Python):
N = int(input())
counter = 0
for A in range(1,N):
  for B in range(1,N//A+1):
    if 0 < A*B < N:
        counter += 1
print(counter)

Solution (Python):
def resolve():
    
    
    
    
    n=int(input())
    ans=0
    for a in range(1,n):
      if n-a*a<=0:
        break
      else:
        ans+=1
    for a in range(1,n-1):
      for b in range(a+1,n):
        if n-a*b<=0:
          break
        else:
          ans+=2
    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N):
    for j in range(1,N):
        if i * j >= N:
            break
        else:
            ans += 1
print(ans)

Solution (Python):
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

def divisor_count(n):
    divisors = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1  
    return divisors    

N = I()
ans = 0




for i in range(1,N):
    ans += (N-1)//i

print(ans)

Solution (Python):
n=int(input())
import math
ans=0
for i in range(1,n):
    ue=math.floor((n-1)/i)
    ans+=ue

print(ans)

Solution (Python):
N = int(input())

ans = 0
for A in range(1, 1000):
    for B in range(A, 1000000):
        C = N - A * B
        if C <= 0:
            break
        
        if A != B:
            ans += 2
        else:
            ans += 1
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def main():
    N = int(input())
    ans = 0
    for a in range(1, N):
        ans += (N-1) // a
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = int(input())
    ans = 0
    for a in range(1, N):
        if N % a == 0:
            b_num = N // a - 1
        else:
            b_num = N // a

        ans += b_num

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n):
    for j in range(i,n):
        if i*j <= n-1:
            if i == j:
                ans += 1
            else:
                ans += 2
        else:
            break
print(ans)

Solution (Python):
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

n = int(input())
divisors = num_divisors_table(n-1)

print(sum(divisors))

Solution (Python):
n = int(input())

count = 0
for a in range(1,n):
  for b in range(1,n):
    if a*b<n:
      count += 1
    else:
      break

print(count)

Solution (Python):
n = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

yakusu = make_divisors(n)
l_yakusu = len(yakusu)
count = 0
yakusu_idx = 0

for a in range(1,n):
    b = n//a
    if b < a:
        break
    if yakusu_idx < l_yakusu and a == yakusu[yakusu_idx]:
        tmp = (b-a)*2
        if tmp>0:
            count += tmp - 1
        yakusu_idx += 1
    else:
        tmp = (b-a+1)*2
        if tmp>0:
            count += tmp -1

print(count)

Solution (Python):
n = int(input())
cnt = 0
for i in range(1,n):
    cnt += (n-1)//i
print(cnt)

Solution (Python):
n = int(input())
y = n
res = 0
for x in range(1, n+1):
    while x*y >= n:
        y -= 1
    res += y
print(res)

Solution (Python):
import math
n=int(input())


maxa=math.floor((n-1)**0.5)


PossibleB=0


for a in range(1,maxa+1):
  
  
  PossibleB += math.floor((n-1)/a)-(a-1)


print(2*PossibleB-maxa)

Solution (Python):
import sys
import math
n = int(sys.stdin.readline().rstrip("\n"))
n_2 = math.ceil(math.sqrt(n))
ans = 0
for a in range(1,n_2):
    q, mod = divmod(n, a)
    if mod == 0:
        bmax = q
    else:
        bmax = q + 1
    for b in range(a,bmax):
        if a == b:
            ans += 1
        else:
            ans += 2
print(ans)

Solution (Python):
def main():
    n = int(input())
    ans_onaji = 0
    ans_dif = 0
    for i in range(1, n):
        for j in range(i, n):
            if i == j and i*j <= n-1:
                ans_onaji += 1
            elif i != j and i*j <= n-1:
                ans_dif += 1
            elif i*j > n-1:
                break
    print(ans_dif * 2 + ans_onaji)






if __name__ == "__main__":
    main()

Solution (Python):
N=int(input())-1
s=0

for i in range(1,N+1):
    s+=N//i

print(s)

Solution (Python):
import math

N=int(input())
z = 0
for i in range(1,N):
    a = math.floor(N / i)
    z += a
    if N % i == 0:
        z -= 1
print(z)

Solution (Python):
def ndt(n):
    table = [0] * (n + 1)
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return table

N=int(input())
print(sum(ndt(N-1)))

Solution (Python):
n=int(input())
a=[1]*(n+1)
a[0]=0
for i in range(2,n+1):
    for j in range(i,n+1,i):
        a[j]+=1
print(sum(a[0:n]))

Solution (Python):



def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))


n = int(input())
cnt = 0
for a in range(1, n):
    u = (n-1) // a
    cnt += u
print(cnt)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,int(n**0.5)+1):
    x = n // i - 1 if n % i == 0 else n // i
    x -= i-1
    ans += x * 2
    if i * i < n:
        ans -= 1 
print(ans)

Solution (Python):

def main():
    N = int(input())
    ans = sum((N-1)//i for i in range(1, N))
    print(ans)

main()

Solution (Python):
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
    n = int(input())
    res = 0
    for c in range(1,n):
        ab = n - c
        col = collections.Counter(prime_factorize(ab))
        r = 1
        for count in col.values():
            r *= count+1
        res += r
    print(res)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
ans = 0
for i in range(1, N):
    if N % i == 0:
        ans += N // i - 1
    else:
        ans += N // i
print(ans)

Solution (Python):

n = int(input())
count = 0
for i in range(1, n):
  a = n // i
  b = n % i
  if b==0:
    count += a-1
  else:
    count += a
print(count)

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    cnt = 0
    for i in range(1,N):
        a = N//i
        if N%i == 0:
            cnt += a-1
        else:
            cnt += a
    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
count=0
for i in range(1,n):
    x=n/i
    if x.is_integer():
        count+=x-1
    else:
        count+=int(x)

print(int(count))

Solution (Python):
n = int(input())

count=0

for i in range(1,n):
  for j in range(1,n):
    if i * j < n:
      count += 1
    else:break

print(count)

Solution (Python):
n = int(input())

cnt = 0
for a in range(1, n):
    for b in range(1, n):
        x = a * b
        if x >= n:
            break
        cnt += 1

print(cnt)

Solution (Python):
N = int(input())

ans = 0

for i in range(1, N):
    ans += (N // i)
    if N % i == 0:
        ans -= 1

print(ans)

Solution (Python):
N=int(input())
ans=0
for i in range(1,N):
   ans+=(N-1)//i
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline


n = int(input())
ans = 0
for i in range(1,n):
    tmp = (n-1)//i
    ans +=tmp
print(ans)

Solution (Python):
n=int(input())
ans=0
for x in range(1,(10**6)+10):
    y=(n-1)/x
    ans+=int(y)
print(ans)

Solution (Python):
import sys
import math


def main():
    N = int(sys.stdin.readline().rstrip())

    cnt = 0
    for A in range(1,N):
        cnt += (N-1) // A

    print(cnt)


main()

Solution (Python):
n = int(input())

cnt=0
for i in range(1,n):
    for j in range(1,n):
        if i*j >= n:
            break
        cnt+=1

print(cnt)

Solution (Python):
def cp(n):
    lp=[0]*(n+1)
    pr=[]
    for i in range(2,n+1):
        if lp[i]==0:
            lp[i]=i
            pr.append(i)
        for p in pr:
            if p*i>n or p>lp[i]:
                break
            lp[p*i]=p
    return lp

def ra(a): 
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append(l)
            l=1
    ll.append(l)
    return ll


n=int(input())
ans=0
cppp=cp(n)
for i in range(1,n):
    c=n-i
    prime=[]
    while c>1:
        prime.append(cppp[c])
        c//=cppp[c]
    l=ra(prime)
    k=1
    for j in l:
        k*=j+1
    ans+=k
print(ans-1)

Solution (Python):
N = int(input())
ans = 0

for i in range(1, N):
    b = N//i
    if i*b == N:
        b -= 1
    
    ans += b
print(ans)

Solution (Python):
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table
    
N = int(input())
    
print(sum(num_divisors_table(N)[:-1]))

Solution (Python):
def main():
    N = int(input())
    cnt = 0
    for i in range(N - 1):
        A = i + 1
        B = 1
        while A * B < N:
            cnt += 1
            B += 1

    print(cnt)
    return


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    n = int(input())
    ans = 0
    
    for a in range(1, n):
        for b in range(1, n):
            if 1 <= a * b <= n - 1:
                ans += 1
            else:
                break
           
    print(ans)

        
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

ans = 0
for i in range(1, N):
    for j in range(i, (N // i) + 1):
        if i * j < N:
            if i == j:
                ans += 1
            else:
                ans += 2
print(ans)

Solution (Python):
N=int(input())
ans=0
for A in range(1,1000001):
    ans+=N//A
    if N%A==0:
        ans-=1
print(ans)

Solution (Python):
LI = lambda: list(map(int, input().split()))

N = int(input())


def main():
    ans = 0
    for a in range(1, N):
        x = N // a
        if N % a == 0:
            x -= 1
        ans += x
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())

count = 0
for i in range(1, N+1):
    count += (N - 1) // i
print(count)

Solution (Python):
def main():
	cnt = 0
	N = int(input())
	for a in range(1,N):
		for b in range(1,N):
			if a*b >= N:
				break
			else:
				cnt += 1
	print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N):
  n = i
  while n < N:
    ans += 1
    n += i
print(ans)

Solution (Python):

import math

N = int(input())

ans = 0

for i in range(1,N+1):
    b = math.ceil(N / i) - 1
    ans += b

print("{}".format(ans))

Solution (Python):
n = int(input())
ans = 0

for i in range(1,n):
    if n % i == 0:
        a = int(n / i - 1)
    else:
        a = int(n // i)
    ans += a

print(ans)

Solution (Python):
import math
n = int(input())
n_sqrt = math.sqrt(n)

l = [2] * (n - 1)
l[0] = 1

for i in range(2, math.floor(n_sqrt) + 1):
  k = (n - 1) // i
  for j in range(2, k+1):
    l[j * i - 1] += 2 if j > n_sqrt else 1
    
print(sum(l))

Solution (Python):

if __name__ == '__main__':
    n = int(input())

    if n == 2:
        print(1)
    else:
        count = 1
        n2=n-1
        for i in range(1,n2):
            count+=n2//i
        print(count)

Solution (Python):
N=int(input())
n=N-1
ans=0
for a in range(1,N):
  B=n//a
  ans+=B
print(ans)

Solution (Python):
n = int(input())

count = 0
for i in range(1, n):
    count += (n-1) // i
    
print(count)

Solution (Python):
N = int(input())
ans = 0
a = 1
while(a < N):
    ans += (N-1)//a 
    a += 1

print(ans)

Solution (Python):
N = int(input())

ans = 0
for a in range(1,N):
    for b in range(1,N):
        c = N - a * b
        if a * b + c == N and c > 0:
            ans += 1
            
        elif a * b > N:
            break

print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(1, N):
    ans += (N-1)//i
    
print(ans)

Solution (Python):

N = int(input())
ans = 0
for A in range(1, N):
  for B in range(1, N):
    if A * B > N-1:
      break
    else:
      ans += 1
print(ans)

Solution (Python):
N = int(input())

num = 0
for a in range(1, N):
  num += (N-1) // a
  
print(num)

Solution (Python):
from collections import Counter


class SmallestPrimeFactors:
    def __init__(self, n):
        self.spf = list(range(n + 1))
        self.spf[0] = -1
        self.spf[1] = -1
        for i in range(2, int(n ** 0.5) + 1):
            if self.spf[i] == i:
                for j in range(i * i, n + 1, i):
                    if self.spf[j] == j:
                        self.spf[j] = i

    def is_prime(self, x):
        return self.spf[x] == x

    def __traverse(self, x):
        if self.spf[x] == x:
            return [x]
        nxt = x // self.spf[x]
        return self.__traverse(nxt) + [self.spf[x]]

    def factor(self, x):
        if x < 2:
            return []
        return self.__traverse(x)


spf = SmallestPrimeFactors(1_000_000)
N = int(input())
ans = 0
for C in range(1, N):
    fac = Counter(spf.factor(N - C))
    tmp = 1
    for v in fac.values():
        tmp *= v + 1
    ans += tmp
print(ans)

Solution (Python):


n = int(input())
count = 0
for a in range(1, n):
    if n % a == 0:
        count += n // a - 1
    else:
        count += n // a
print(count)

Solution (Python):
n = int(input())
a = 1
cnt = 0
while n > a:
    cnt += (n-1) // a
    a += 1

print(cnt)

Solution (Python):
from math import sqrt as r
from math import floor

N = int(input())
n = N - 1
ans = 0

for A in range(1, N):
    B = n // A
    ans += B

print(ans)

Solution (Python):
n=int(input())
L=[*range(n)]
S=[1]*n
for i in range(2,n):
  for j in range(i,n,i):
    a=0
    while L[j]%i<1:
      L[j]//=i
      a+=1
    S[j]*=a+1
print(sum(S)-1)

Solution (Python):
N = int(input())
cnt = 0
for i in range(1,N):
    if N%i!=0:
        cnt+=N//i
    else:
        cnt+=N//i-1

print(cnt)

Solution (Python):
n = int(input())
if n%2:
    h = n//2
else:
    h = n//2+1
count=0
for i in range(h+1,0,-1):
    judge = n//i
    if n%i == 0:
        count=count+judge-1
    else:count += judge
for i in range(h+2,n):
    count+=1

print(count)

Solution (Python):
def c_a_times_b_plus_c():
    N = int(input())
    ans = 0
    for a in range(1, N + 1):
        for b in range(N // a, 0, -1):
            if N - a * b >= 1:
                ans += 1
    return ans

print(c_a_times_b_plus_c())

Solution (Python):
import sys

N = int(input())

ans = 0

for i in range(1, N):
    if i == 1:
        ans += N - 1
        continue

    if i * 2  + 1 <= N:
        ans += (N - 1) // i 
    else:
        ans += N - i
        break

print(ans)

Solution (Python):
N = int(input())

cnt = 0
for i in range(1,N):
    cnt += (N-1) // i

print(cnt)

Solution (Python):
n = int(input())

is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(n**0.5) + 1):
    if is_prime[i] != True:
        continue
    for j in range(i * 2, n + 1, i):
        is_prime[j] = i



def factorization3(l):
    
    num = 1
    temp = l 
    
    while is_prime[temp] != True and temp != 1:
        k = is_prime[temp]
        cnt=0
        while temp % k == 0:
            cnt+=1
            temp //= k
        num *= (cnt+1)

    if temp!=1:
        num *= 2

    if num == 1:
        num *= 2

    return num


total = 1
for x in range(2,n):
  y = factorization3(x)
  total += y
print(total)

Solution (Python):
n = int(input())
res = 0
for a in range(1, n):
  res += ((n - 1) // a)
print(res)

Solution (Python):


import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def get_factor(N):
    N1 = N + 2
    A = [2, 0] * (N1//2)

    for i in range(3, N1, 2):
        if A[i]:
            continue
        for j in range(i, N1, 2*i):
            A[j] = i

    def factor(n):
        i = 0
        ans = []

        while n & 1 == 0:
            i += 1
            n >>= 1
        if i:
            ans.append((2, i))

        while n > 1:
            a = A[n]
            i = 1
            while True:
                n //= a
                b = A[n]
                if a != b:
                    ans.append((a, i))
                    b = a
                    break
                i += 1

        return ans


    return factor

def resolve():
    N = int(sys.stdin.readline())

    f = get_factor(N)

    ans = 0
    for i in range(1, N):
        num = 1
        
        for a, b in f(i):
            num *= b + 1
        ans += num
    print(ans)
if __name__ == "__main__":
    resolve()

Solution (Python):
n = int(input())

ans = 0
a = 1
while a < n:
    s = (n - 1) // a
    ans += s

    s = 0
    a += 1

print(ans)

Solution (Python):
n=int(input())
res=0
for i in range(1,n):
  res+=(n-1)//i
print(res)

Solution (Python):
N = int(input())

cnt = 0

for i in range(1, N):
    cnt += (N-1)//i
    
print(cnt)

Solution (Python):
N = int(input())

ret = 0
for a in range(1, N + 1) :
  ret += (N - 1) // a
  
print(ret)

Solution (Python):
n = int(input())
c = 0
for i in range(1,n):
  c += (n-1)//i
print(c)

Solution (Python):
import math
n=int(input())
ans=0
for i in range(1,int(math.sqrt(n))+1):
    for j in range(i,(n-1)//i+1):
        k=n-i*j
        if k>0:
          if i==j:
            ans+=1
          else:
            ans+=2
print(ans)

Solution (Python):
n=int(input())
c=0
for i in range(1,n//2+2):
    for j in range(i,n//i+1):
        s=i*j
        if(s<n):
            if(i!=j):
                c+=2
            else:
                c+=1
print(c)

Solution (Python):


def solve(N: int):
    ans = 0
    for i in range(1, N):
        if N % i == 0:
            ans += (N / i) -1
        else:
            ans += (N // i)
    print(int(ans))

    return



def main():
    N = int(input())
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import math
n=int(input())
l=int(math.sqrt(n))
x=0
l=int(math.sqrt(n))
for i in range(1,l+1):
    y=(n-1)//i-i+1
    x+=2*(y-1)+1
if l*l==n:
    x+=1

print(x)

Solution (Python):
n = int(input())
ans = 0
for a in range(1, n+1):
    for b in range(1, n//a+1):
        c = n-a*b
        if a*b+c == n and c >= 1:
            
            ans += 1
print(ans)

Solution (Python):
n=int(input())
ans=0
for a in range(1,n+1):
    for b in range(1,n+1):
        if n<=a*b:
            break
        ans+=1
print(ans)

Solution (Python):
N=int(input())
half = int(N**0.5)
if half**2==N:
  half-=1
ans = 0
for i in range(1, (half+1)):
  tmp = (N-1)//i
  
  ans += (tmp + (tmp-half))
print(ans)

Solution (Python):
n=int(input())

ans=0

for i in range(1,n):
    ans+=(n-1)//i

print(ans)

Solution (Python):
def main():
    n = int(input()) - 1
    ans = 0

    for i in range(1, n+1):
        ans += n//i

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
ans=0
for i in range(n):
  b=(n-1)//(i+1)
  ans=ans+b
print(ans)

Solution (Python):
N = int(input())

ans = 0
for A in range(1, N + 1):
    ans += (N - 1) // A

print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n):
  if n % i == 0:
    ans += n // i - 1
  else:
    ans += n // i
print(ans)

Solution (Python):
import math
def check(x):
    return math.sqrt(x) == int(math.sqrt(x)) and x != 1

n = int(input())
a = [1]* (n +1);
for i in range(2, n+1):
    for j in range(i, n+1, i):
        if j // i != i:
            a[j] += 1
        else:
            a[j] += 2
ans = 0
for i in range(1, n):
    ans += a[n - i] if not check(n-i) else a[n-i] - 1

print(ans)

Solution (Python):
n = int(input())
result = 0
for a in range(1, n):
	
	result += (n - 1) // a
print(result)

Solution (Python):
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy

n = int(input())




ans = 0
for i in range(1, n):
    a = (n-1) // i
    
    ans += a

print(ans)

Solution (Python):
from collections import defaultdict
N=int(input())

sq_set=set()
for i in range(1,10**3+1):
  sq_set.add(i*i)


alist=[i for i in range(N)]
dlist=[i for i in range(N+1)]
for i in range(2,int(N**0.5)+1):
  if dlist[i]<i:
    continue
  else:
    for j in range(i**2,N+1,i):
      dlist[j]=i  


answer=1
for i in range(1,N-1):
  AB=N-i
  AB_copy=AB
  facts=defaultdict(int)
  while AB>1:
    facts[dlist[AB]]+=1
    AB//=dlist[AB]
    
  num_div=1
  for k,v in facts.items():
    num_div*=v+1
    
  
  answer+=num_div
  
print(answer)

Solution (Python):

n  = int(input())
ans = 0
for i in range(1,1000000):
    a2 = (n-1)//i
    ans += a2
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n):
    p = n // i
    if p * i < n:
        ans += p
    else:
        ans += p - 1
print(ans)

Solution (Python):

N = int(input())
ans = 0
for i in range(1, N):
    ans += (N-1)//i
    
print(ans)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

    count = 0

    tmp_list = [i for i in range(1,n)]

    for i in range(1, n):
        insert_index = bisect_right(tmp_list, n//i)
        if i * insert_index == n:
            insert_index -= 1
        count += insert_index

    print(count)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
cnt = 0
for a in range(1,N):
  b = (N-1) // a
  cnt += b
      
print(cnt)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

    
    ans = 0
    for i in range(1, N):
        ans += (N - 1) // i

    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):
n = int(input())
cnt = 0
prim = [1]*(n)
for i in range(2,n):
  k = i
  while k<n:
    prim[k] += 1
    k += i
for i in range(1,n):
  tmp = n-i
  cnt += prim[tmp]
print(cnt)

Solution (Python):
def number(N):
    m=0
    for i in range(1,N+1):
        for j in range(1,N//i+2):
            if N-i*j>0:
                m+=1
    return m
N=int(input())
print(number(N))

Solution (Python):
def resolve():
	N = int(input())
	res = 0
	for n in range(1, N):
		res += (N-1)//n
	print(res)
resolve()

Solution (Python):
N=int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors
lis=[1]*10**6

ans=1
for i in range(1,N-1):
    now=i+1
    while now<=10**6:
        lis[now-1]+=1
        
        now+=(i+1)
    ans+=lis[i]

print(ans)

Solution (Python):



def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

def main():
    N = int(input())
    table = num_divisors_table(N)
    ans = 0
    for c in range(1, N):
        
        
        ab = table[N-c]
        ans += ab
    print(ans)
        
if __name__ == "__main__":
    main()

Solution (Python):
def main():
  N = int(input())
  count = 0
  for i in range(1,N):
    M = (N-1) // i
    for j in range(1,M+1):
      count += 1
  print(count)
  
main()

Solution (Python):
import math
N = int(input())

k = 0
for a in range(1,N) :
    bmax = math.floor((N-1)/a)
    
    k = k + bmax

print(k)

Solution (Python):
def resolve():
    N = int(input())
    Ans = 0
    for a in range(1, N + 1):
        maxb = (N - 1) // a
        Ans += maxb
    print(Ans)
    
resolve()

Solution (Python):
n=int(input())
a=0
b=0
for i in range(1,n):
  for j in range(i,n):
    if i*j<n:
      if i==j:
        b+=1
      else:
        a+=1
    else:
      break
print(a*2+b)

Solution (Python):
import sys


def resolve(in_):
    N = int(next(in_))
    
    

    ans = 0
    for a in range(1, N + 1):
        b, m = divmod(N, a)
        if m == 0:
            b -= 1
        ans += b

    return ans



def main():
    answer = resolve(sys.stdin)
    print(answer)

if __name__ == '__main__':
    main()

Solution (Python):

N = int(input())
ans = 0

for a in range(1, N):
    ans += ((N-1) // a)
print(ans)

Solution (Python):
import sys
from math import *

def input(): return sys.stdin.readline().rstrip("\r\n")
def List(): return list(map(int, input().split()))
def Num(): return int(input())


n = Num()
ans = 0
for i in range(1, n + 1):
    ans += n // i


def div(n):
    count = 0
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            if n // i == i:
                count += 1
            else:
                count += 2
    return count


print(ans - div(n))

Solution (Python):
n=int(input())
s=0
for i in range(1,10**6+1):
    s=s+(n-1)//i
print(s)

Solution (Python):
n=int(input())
n=n-1
ans=0
for i in range(1,n+1):
    ans+=n//i
print(ans)

Solution (Python):

import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)

def main():
    N = int(input())

    ans = 0
    for a in range(1, N + 1):
        for b in range(a, N + 1):
            if a * b > N - 1:
                break
            else:
                ans += 1
                if a != b:
                    ans += 1
    print(ans)







if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
sm=0
for i in range(1,n):
  sm+=(n-1)//i
print(sm)

Solution (Python):
n = int(input())
c = 0
for i in range(1, (n // 2) + 1):
    if i ** 2 >= n:
        break
    if n % i == 0:
        a = n // i - 1
    else:
        a = n // i
    c += 2 * (a - i) + 1
print(c)

Solution (Python):
n = int(input())
c=0
for i in range(1,n):
  a = 0
  while a<n-i:
    a+=i
    c+=1

print(c)

Solution (Python):
n = int(input())
cnt = 0
i=1
for i in range(1,n):
    a=int((n-1)/i)
    cnt+=a
print(cnt)

Solution (Python):
from math import sqrt
from collections import Counter

def primes(N):
    is_prime = [True]*(N+1)
    is_prime[0] = False
    is_prime[1] = False
    D = [0]*(N+1)
    for n in range(2, int(sqrt(N)+1)):
        if is_prime[n]:
            D[n] = n
            j = n+n
            while j <= N:
                is_prime[j] = False
                D[j] = n
                j+=n
    for n in range(int(sqrt(N)), N+1):
        if is_prime[n]:
            D[n] = n
                
    return is_prime, D

def solve(N):
    is_prime, D = primes(N)
    total = 0
    for c in range(1, N-1):
        if is_prime[N-c] and False:
            total += 2
            continue

        C = Counter()
        x = N-c
        while x >= 2:
            d = D[x]
            C[d] += 1
            x //= d
        a = 1
        for k, v in C.items():
            a *= (v+1)
        
        total += a
    
    total += 1
    return total

N = int(input())
print(solve(N))

Solution (Python):
n = int(input())

if n==1:
    print(0)
    exit()

ans = 1
ans += (n-2)*2

for i in range(2,n-1):
    ans += (n-1)//i-1
print(ans)

Solution (Python):
N = int(input())
answer = 0
for i in range(1,N):
    if N % i == 0:
        answer += (N // i - 1)
    else:
        answer += N // i
print(answer)

Solution (Python):
import math
n=int(input())

cnt=0
for a in range(1,n+1):
    cnt+=math.floor((n-1)/a)
print(cnt)

Solution (Python):
n = int(input())
cnt = 0

for i in range(1,n+1):
  cnt += (n-1)//i
print (cnt)

Solution (Python):
n = int(input())

ans = 0
for a in range(1, n):
    for b in range(1, n //a + 1):
        if a * b < n:
            ans += 1

print(ans)