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())
count=0
daburi=0
for i in range(1,n):
    count+=(n-1)//i

print(count)

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

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

print(count)

Solution (Python):
from collections import Counter


def main():
    n = int(input())
    prime = [2, ]
    X = [i for i in range(0, n + 1)]
    for i in range(3, n + 1):
        x = i ** 0.5
        for p in prime:
            if p > x:
                prime.append(i)
                break
            if i % p == 0:
                X[i] = p
                break
        else:
            prime.append(i)

    def cnt(n):
        L = list()
        while n != 1:
            L.append(X[n])
            n //= X[n]
        C = Counter(L)
        ans = 1
        for c in C.values():
            ans *= c + 1
        return ans
    print(sum(cnt(i) for i in range(1, n)))



if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a = 0
b = 0
c = 0
while a < n:
    a+=1
    if a == n:
        break
    if n%a == 0:
        c+= n//a - 1
    else:
        c+= n//a
print(c)

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

print(n)

Solution (Python):
from sys import stdin
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
ans = 0
n = int(stdin.readline().rstrip())
for c  in range(1,n):
    cnt = 1
    n2 = n - c
    
    data = collections.Counter(prime_factorize(n2))
    tmp = list(data.values())
    for x in range(len(tmp)):
        cnt *= tmp[x] + 1
    ans += cnt
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):
import math

n = int(input())

ans = 0

for a in range(n):
    ans += math.floor(n/(a+1)-1)
    if n % (a+1) != 0:
        ans +=1

print(ans)

Solution (Python):
from sys import stdin
input=stdin.readline
n=int(input().rstrip())
count=0
for i in range(1,n):
    
    for t in range(1,n):
        if n-i*t>0:
            count +=1
        else:
            break
print(count)

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

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

Solution (Python):



import sys
from math import ceil

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

m = 10**6 + 1000
div = [0, 1] + [2] * m
for i in range(2, len(div)):
    for j in range(2 * i, len(div), i):
        div[j] += 1

def main():
    N = i2n()
    ans = 0
    for n in range(1, N):
        ans += div[n]
    print(ans)
    return

main()

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

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

print(ans)

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

Solution (Python):
N = int(input())
if N == 2:
    print(1)
    import sys
    sys.exit()
if N == 3:
    print(3)
    import sys
    sys.exit()


s = 0
m = N//2 if N%2 == 0 else N//2 + 1
for n in range(1, m):
    s += (N//n if N%n != 0 else N//n - 1)

print(s+N//2)

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 

  
N = int(input())

d =[0] * (N+1)
for i in range(1,N+1):
  div = collections.Counter(prime_factorize(i))
  index = list(div.values())
  s = 1
  for j in range(len(index)):
    s *= (index[j]+1)
  d[i] = s
sum = 0
for i in range(1,N):
  sum += d[N-i]
  
print(sum)

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

ans = 0

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

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

for a in range(1, n):
  for b in range(n//a):
    num += 1
  if n % a == 0:
    num -= 1

print(num)

Solution (Python):
"""O(N^0.5) solution"""

N = int(input())
N -= 1

ans = 0
n = int(N**.5)
for x in range(1, n+1):
  
  ans += 1
  
  ans += N//x - x
  
  ans += N//x - x

print(ans)

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

print(count)

Solution (Python):
import math

n = int(input())
mod = 0
if (n-1)%2 != 0:
    mod = 1

b = math.ceil((n-1)**0.5)
cnt = 0

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

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

Solution (Python):
import math
n=int(input())
cnt=0
temp=math.ceil(math.sqrt(n))
for i in range(1, temp+1):
  for j in range(1, temp+1):
    if i!=j and i*j<n:
      cnt+=1
    elif i==j and i*j<n:
      cnt+=1
for k in range(temp+1, n):
  for l in range(1, temp+1):
    if k*l<n:
      cnt+=2
    else:
      break;
print(cnt)

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

Solution (Python):
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

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

n=I()
dp=[0]*(n+1)
dp[2]=1
for i in range(3,n+1):
    c=collections.Counter(prime_factorize(i-1))
    divnum=list(c.values())
    tmp=1
    for j in divnum:tmp*=j+1
    dp[i]=dp[i-1]+tmp
print(dp[n])

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

Solution (Python):
import sys
import re
import queue
import collections
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 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []


def main():
	N = i_input()
	sum = 0
	for i in range(1,N):
		sum += (N-1) // i

	print(sum)

	return

if __name__ == '__main__':
	main()

Solution (Python):
import math


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

    count = 0
    sqr = int(math.sqrt(N-1))
    for a in range(1, sqr+1):
        count += (len([m+1 for m in range((N-1)//a) if m+1 >= a]) - 1) * 2 + 1
    print(count)

main()

Solution (Python):
import math
n = int(input())
m = int(math.sqrt(n))
if n == m ** 2:
    m -= 1

ans = 0
for i in range(1, m + 1):
    t = int((n - 1) / i)
    ans += (t- i + 1) * 2
    if n != i ** 2:
        ans -= 1 
print(ans)

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

arr = set()
for a in range(1, int(math.sqrt(N))+1):
    for b in range(a, N+1):
        if N-(a*b) <= 0:
            break
        ans += 2
        if a == b:
            ans -= 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())
sum = 0


for A in range(1,N):
  if N // A > 1:
    if  N % A == 0:
      sum += N//A -1
    else:
      sum += N // A
  else:
    sum += 1

print(sum)

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

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

Solution (Python):
import numpy as np
from numba import njit
u4 = np.uint32

@njit
def get_factorization(n):
    sieve_size = (n - 1) // 2
    sieve = np.ones(sieve_size, u4)
    for i in range(sieve_size):
        if sieve[i] == 1:
            value_at_i = i*2 + 3
            for j in range(i, sieve_size, value_at_i):
                value_at_j = j * 2 + 3
                p = 1
                while value_at_j % value_at_i == 0:
                    value_at_j //= value_at_i
                    p += 1
                sieve[j] *= p
    return sieve


@njit('(u4,)', cache=True)
def solve(N):
    sieve = get_factorization(N)
    ans = 0
    for j in range(1, N):
        a = j
        p2 = 1
        while a % 2 == 0:
            p2 += 1
            a //= 2
        if a > 1:
            s_a = (a - 3) // 2
            ans += p2 * sieve[s_a]
        else:
            ans += p2
    return ans


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

main()

Solution (Python):
if __name__=="__main__":
  N = int(input())
  ans = 0
  for a in range(1, N):
    num = (N-1)//a
    ans += num
  print(ans)

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

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

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

Solution (Python):
import collections
def pf(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
  
n=int(input())
r=0
for c in range(1,n):
  ab=collections.Counter(pf(n-c))
  ab_l=list(ab.values())
  x=1
  for i in ab_l:
    x*=i+1
  r+=x
print(r)

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

count=0
for a in range(1,n+1):
    for b in range(a,n//a+1):
        c=n-(a*b)
        if c>0:
            if a==b:
                count+=1
            else:
                count+=2
        else:
            continue

print(count)

Solution (Python):
import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict,deque
import math
def main():
    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)


BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Solution (Python):

n=int(input())
ans=0
for i in range(1,n):
	temp=(n-1)//i
	if temp>0:
		ans+=temp
	else:
		break
print(ans)

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

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

print(count)

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

d =[0] * (10**6+1)
for i in range(1,10**6+1):
  div = collections.Counter(prime_factorize(i))
  index = list(div.values())
  s = 1
  for j in range(len(index)):
    s *= (index[j]+1)
  d[i] = s
  

N = int(input())
sum = 0
for i in range(1,N):
  sum += d[N-i]
  
print(sum)

Solution (Python):
n=int(input());count=0
for i in range(1,n):
  count+=[n//i,n//i-1][n%i==0]
print(count)

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())

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

print(counter)

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

count = 0
count2 = 0

for a in range(2, n + 1):
    if n > a ** 2:
        count += 1
        if n % a == 0:
            count += 2 * ((n // a) - a - 1)
        else:
            count += 2 * (n // a - a)
    else:
        break
print(count+1+2*(n-2))

Solution (Python):
from sys import stdin, stdout
import math
inp = lambda : stdin.readline().strip()
   
n = int(inp())
ans = 0
for i in range(1, n):
    l = 1
    r = n
    while l < r:
        m = (l+r)//2
        if m*i >= n:
            r = m
        else:
            l = m+1
    ans += l-1
print(ans)

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

Solution (Python):
N = int(input())
n=int(N**0.5)
cnt=0
for i in range(1,n+1):
    a=N//i
    if a-i-1>0:
        cnt+=(a-i-1)*2
    if i**2!=N:
        cnt+=1
    if a*i!=N and a!=i:
        cnt+=2
print(cnt)

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

Solution (Python):
import math

def solve():
    n = int(input())
    ct = 0
    for a in range(1, n):
        ct += math.ceil(n/a - 1)
    return ct

print(solve())

Solution (Python):
N = int(input())
c = []
ans = 1

import collections
ans = 1
all_ans = 0
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

for i in range(1, N):
  ans = 1
  c = collections.Counter(prime_factorize(N-i))
  for i in c.values():
    ans *= (i+1)
  all_ans += ans

print(all_ans)

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

yakusuu_table = [0] * N

for i in range(1, N):

    for j in range(i,N,i):
        yakusuu_table[j] += 1
print(sum(yakusuu_table))

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

count = 0

for a in range(1, int(n/2) + 1):
	count += (n-1) // a

count += n - 1 - int(n/2)

print(count)

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

cnt = 0

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

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

Solution (Python):
N=int(input())
from math import floor
a=floor(N**(1/2))
i=1
summ=0
for i in range(1,a+1):
    if N%i==0:
        b=N//i
        if b>i:
            summ=summ+(b-i)*2-1
    else:
        b=N//i
        summ=summ+(b-i+1)*2-1
    i+=1
print(summ)

Solution (Python):
from math import floor
n = int(input())
qnt = 0
for x in range(1, n):
	y = n / x
	y = int(y)-1 if y%1 == 0 else int(floor(y))
	qnt += y
print(qnt)

Solution (Python):
N = int(input())
under_prod = N-1
A=1
even = 0
count = 0

for i in range(under_prod):
  B=under_prod//A
  count+=B
  A+=1


print(count)

Solution (Python):
import itertools
import collections


def prime_factor_table(n):
    table = [0] * (n + 1)

    for i in range(2, n + 1):
        if table[i] == 0:
            for j in range(i + i, n + 1, i):
                table[j] = i

    return table


def prime_factor(n, prime_factor_table):
    prime_count = collections.Counter()

    while prime_factor_table[n] != 0:
        prime_count[prime_factor_table[n]] += 1
        n //= prime_factor_table[n]
    prime_count[n] += 1

    return prime_count


def solve(N):
    ans = 1

    table = prime_factor_table(1000000)

    for i in range(2, N):
        tmp = prime_factor(i, table)
        tt = 1
        for t in tmp:
            tt *= (tmp[t]+1)
        ans += tt
    return ans


if __name__ == "__main__":
    N = int(input())
    print(solve(N))

Solution (Python):



from math import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq














import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7


INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())

is_prime = [1] * (10**6+1)

for a in range(2,10**6+1):
        for v in range(a,10**6+1,a):
            is_prime[v] += 1


n = I()
ans = 0
for c in range(1,n):
    nc = n-c
    ans += is_prime[nc]
print(ans)

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

primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

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

Solution (Python):
import math

N = int(input()) - 1

B = [2 for i in range(N)]

for i in range(2, math.ceil(math.sqrt(N))+1):
  for j in range(2*i, N+1, i):
    B[j-1] += 1

    if math.ceil(math.sqrt(N)) < j//i:
      B[j-1] += 1

print(sum(B)-1)

Solution (Python):
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前
sort()
sorted(reverse=true)
配列の初期化
配列名=[a]*n+[b]*m
Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions
import sys


num = int(stdin.readline().rstrip())
res = 0
for el in range(1, num):
    tes = num % el
    tmp = int(num/el)
    if tes == 0:
        tmp -= 1
    res += tmp
print(res)

Solution (Python):
N = int(input(""))
A = 1
B = 1
count = 0
while A * B < N:
    while A * B < N:
        count += 1
        B += 1
    B = 1
    A += 1
    count += 1

print(count - N + 1)

Solution (Python):
n = int(input())
ans = 0
t = 0
J = 0
for i in range(1,n):
    for j in range(i,n):
        if i*j >= n:break
        if i == j : t+=1
        ans +=1
        J = j
    if i*J >= n:break

print(2*ans -t)

Solution (Python):
import math

N = int(input())

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

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

Solution (Python):


n=int(input())



cnt = 0
hey = 0
for a in range(1, n):
    for b in range(a, n):
        if a * b >= n:
            break
        if a != b:
            cnt += 1
        else:
            hey += 1
print(cnt * 2 + hey)

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

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


div = [1] * (N+1)
div[0] = 0

for p in range(2, N+1):
  if div[p] != 1:
    continue
  
  pp = p  
  e = 1
  while pp <= N:
    for n in range(pp, N+1, pp):
      div[n] += div[n] // e
    e += 1
    pp *= p  

ans = sum(div[:N])
print(ans)

Solution (Python):
from sys import stdin
import math
inp = lambda : stdin.readline().strip()

n = int(inp())
ans = 0
for i in range(1,n):
    l = 0
    h = n + 1
    while l < h:
        m = (h+l)//2
        if i * m >= n:
            h = m
        else:
            l = m + 1
    ans += (l-1)
print(ans)

Solution (Python):
N = int(input())
i = 1
s = 0
while i < N:
    s += (N - 1) // i
    i += 1
print(s)

Solution (Python):
N = int(input())
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

table = num_divisors_table(N)

ans = 0
for C in range(1, N):
    ans += table[N-C]
print(ans)

Solution (Python):

def main():
    N = int(input())
    count = 0
    for i in range(1, N):
        for j in range(1, N // i + 1):
            k = N - i*j
            if k > 0:
                count += 1
    print(count)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import math
N = int(input())
n = N-1
rn = int(math.floor(math.sqrt(n)))
c = 0
for i in range(n):
  c += (n//(i+1)*2)
print(int(c/2))

Solution (Python):
def divisorcount(N):
    ans = 0
    divisor = [0]*N
    for i in range(1,N+1):
        ans += (n-1)//i
    return ans

import math
n = int(input())
bf = [0]*int(10**6+1)

N = n - 1

print(divisorcount(N))

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

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

Solution (Python):
n = int(input())
cnt = 0
m = [1]*n
m[0] = 0
ans = 0
for i in range(2,n):
    tmp = i
    for j in range(i,n,i):
        m[j]+=1

for i in range(n):
    if m[i]%2==1:
        ans += 2*(m[i]//2)+1
    else:
        ans += m[i]
print(ans)

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

Solution (Python):
def gcd(a, b):
    while b: a, b = b, a % b
    return a
def isPrimeMR(n):
    d = n - 1
    d = d // (d & -d)
    L = [2, 7, 61] if n < 1<<32 else [2, 3, 5, 7, 11, 13, 17] if n < 1<<48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1: continue
        while y != n - 1:
            y = y * y % n
            if y == 1 or t == n - 1: return 0
            t <<= 1
    return 1
def findFactorRho(n):
    m = 1 << n.bit_length() // 8
    for c in range(1, 99):
        f = lambda x: (x * x + c) % n
        y, r, q, g = 2, 1, 1, 1
        while g == 1:
            x = y
            for i in range(r):
                y = f(y)
            k = 0
            while k < r and g == 1:
                ys = y
                for i in range(min(m, r - k)):
                    y = f(y)
                    q = q * abs(x - y) % n
                g = gcd(q, n)
                k += m
            r <<= 1
        if g == n:
            g = 1
            while g == 1:
                ys = f(ys)
                g = gcd(abs(x - ys), n)
        if g < n:
            if isPrimeMR(g): return g
            elif isPrimeMR(n // g): return n // g
            return findFactorRho(g)
def primeFactor(n):
    i = 2
    ret = {}
    rhoFlg = 0
    while i * i <= n:
        k = 0
        while n % i == 0:
            n //= i
            k += 1
        if k: ret[i] = k
        i += i % 2 + (3 if i % 3 == 1 else 1)
        if i == 101 and n >= 2 ** 20:
            while n > 1:
                if isPrimeMR(n):
                    ret[n], n = 1, 1
                else:
                    rhoFlg = 1
                    j = findFactorRho(n)
                    k = 0
                    while n % j == 0:
                        n //= j
                        k += 1
                    ret[j] = k

    if n > 1: ret[n] = 1
    if rhoFlg: ret = {x: ret[x] for x in sorted(ret)}
    return ret
def sqrt(n):
    x = 1 << (n.bit_length() + 1) // 2
    y = (x + n // x) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x
def calc(k):
    return (sqrt(8*k+1) - 1) // 2

N  = int(input())
cnt = 0
for i in range(1, N):
    tmp = 1
    pf = primeFactor(i)
    for v in pf.values():
        tmp *= v + 1
    cnt += tmp
print(cnt)

Solution (Python):
import math
N = int(input())
ans = 0
A = [0] * (N + 1)
for i in range(2, N):
  ans += (N-1) // i - 1
ans += (N-2)*2 + 1


print(ans)

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

Solution (Python):
import math


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())


summ = 0

summ = sum(num_divisors_table(N-1))
print(summ)

Solution (Python):




n = int(input())







count = 0
for a in range(1, n - 1):
    if n % a != 0:
        b = n // a
    else:
        b = n // a - 1
    if a <= b:
        count = (count + b)
    else:
        count = (count + b)
    

print(count + 1)

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

ans = 0

for i in range(1,n):
    for j in range(i, n):
        if n - i*j < 0:
            break

        if n - i*j > 0 and i == j:
            ans += 1
        elif n - i*j >0 and i != j:
            ans += 2

print(ans)

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

Solution (Python):
import math
N = int(input())
cnt = 0
for a in range(1,N):
  for b in range(a,math.ceil(N/a)):
    c = N - a * b
    if c <= 0:
      break
    else:
      if a == b:
        cnt += 1
      else :
        cnt += 2
print(cnt)

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

Solution (Python):
import math

N=int(input())

ans=0

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

print(ans)

Solution (Python):
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
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 main():
    n = i_input()
    ans = 0
    for i in range(1,n):
        ans += (n-1)//i
    print(ans)


if __name__=="__main__":
    main()

Solution (Python):
N=int(input())
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
print(sum(num_divisors_table(N-1)))

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

j = 0

ans = 0

for i in range(1, n):
    
    j = i
    
    while True:
        j += 1
        if i * j > n:
            break
        ans += 1


k = 1

er = 0

while True:
    er += 1
    if k ** 2 > n:
        break
    k += 1


print((ans * 2) + er - 1)

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


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

print(cnt)

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


div = [0] * (N+1)
for d in range(1, N+1):
  for n in range(d, N, d):
    div[n] += 1

ans = sum(div[:N])
print(ans)

Solution (Python):

import sys, math
def solve(N: int):
    count = 0
    for i in range(1, N):
        a = N//i
        if i* a < N:
            count += a
        else:
            count += a-1
    print(count)
    return
def main():
    solve(int(sys.stdin.readline().rstrip()))

if __name__ == '__main__':
    main()

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

"""
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)

    divisors.sort()
    return divisors

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)
"""

n = k()

for i in range(1,n):
  for j in range(n//i,0,-1):
    if 1<=i*j<=n-1:
      cnt += 1
      continue

print(cnt)

Solution (Python):
from math import floor, ceil

def main():
    n = int(input())
    cnt = 0
    for a in range(1, n):
        cnt += floor((n-1)/a) - ceil(1/a) +1
    print(cnt)
    
    
if __name__ == "__main__":
    main()

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

Solution (Python):
n = int(input())
cnt = 0
for i in range(1, 10**6):
    for j in range(1, 10**6):
        if i * j >= n :
            break
        else :
            cnt += 1
print(cnt)