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):
import math
N=int(input())

def era(n):
  prime=[]
  furui=list(range(2,n+1))
  while furui[0]<math.sqrt(n):
    prime.append(furui[0])
    furui=[i for i in furui if i%furui[0]!=0]
  return prime+furui

furui=era(10**6+7)
minfac=list(range(10**6+8))
for i in furui:
  for j in range(i,(10**6+7)//i+1):
    if minfac[i*j]==i*j:
      minfac[i*j]=i

ans=0   
for i in range(1,N):
  temp=1
  temp2=1
  l=1
  while i != 1:
    if minfac[i]!=l:
      temp*=temp2
      temp2=2
    else:
      temp2+=1
    l=minfac[i]
    i//=l
  temp*=temp2
  ans+=temp
print(ans)

Solution (Python):
n = int(input())
cnt = 0
for a in range(1, n):
    bn = (n-1) // a
    for b in range(1, bn+1):
        c = n-(a*b)
        if c<=0: break
        if a*b + c == n:
            cnt += 1
print(cnt)

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

ans = 0

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

print(ans)

Solution (Python):
from collections import Counter
import math
import statistics
import itertools
a=int(input())







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

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

Solution (Python):
def c_a_times_b_plus_c():
    N = int(input())
    return sum((N - 1) // a for a in range(1, N))

print(c_a_times_b_plus_c())

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

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 i in range(1, N):
    ans += (N - 1) // i

print(ans)

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

Solution (Python):
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')


n = int(input())
ans = 0
for a in xrange(1,n+1):
    for b in xrange(a, n+1):
        if (a*b < n):
            if (a==b):
                ans += 1
            else:
                ans += 2
        else:
            break
print(ans)

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

ans = 0
for a in range(1,N):
    if a**2 < N:
        ans += 1
    for b in range(a+1,N):
        if a * b < N:
            ans += 2
        else:
            break

print(ans)

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

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

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from collections import Counter
def resolve():
    n = int(input())

    sieve = list(range(n + 1))
    primes = []
    for i in range(2, n + 1):
        if sieve[i] == i:
            primes.append(i)
        for p in primes:
            if p * i > n or sieve[i] < p:
                break
            sieve[p * i] = p

    ans = 0
    for i in range(1, n):
        C = Counter()
        while i > 1:
            C[sieve[i]] += 1
            i //= sieve[i]
        score = 1
        for val in C.values():
            score *= val + 1
        ans += score
    print(ans)
resolve()

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

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

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

Solution (Python):
import math

N = int(input())

count = 0
for A in range(1, N):
    for B in range(1, math.ceil(N/A)):
        if A * B < N:
            count += 1
print(count)

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

print(ans)

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

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

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

Solution (Python):
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)
main()

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

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

Solution (Python):




import bisect



    







mod = 998244353
INF = 1<<50

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

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

if __name__=='__main__':
    main()

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

ans = 0

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

print(ans)

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

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

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

if __name__ == "__main__":
  resolve()

Solution (Python):
from collections import Counter

n = int(input())

if n == 1:
    print(0)
else:
    lis = [i for i in range(n+1)]
    for i in range(2, int(n**0.5) + 1):
        if lis[i] == i:
            lis[i] = i
            for j in range(i**2, n+1, i):
                if lis[j] == j:
                    lis[j] = i

def bunkai(m):
    ans = []
    now = lis[m]
    cnt = 1
    for i in range(m):
        m = m//lis[m]
        if now == lis[m]:
            cnt += 1
        else:
            ans.append(cnt)
            cnt = 1
            now = lis[m]
        
        if m == 1:
            break
    return ans

ans = 1
for i in range(2,n):
    tmp = 1
    yaku = bunkai(i)
    for i in yaku:
        tmp *= (i +1)
    ans += tmp

print(ans)

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

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

print(cnt)

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

count = 0

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

print(count)

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

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

    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):
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)

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)

Solution (Python):
import sys
import math
 
input = sys.stdin.readline
 
N = int(input())
 
total = 0
for i in range(1, N):
    total += (N-1) // i
 
print(total)

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

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

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

N=int(readline())


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

print(ans)

Solution (Python):
import math
import numpy as np
n = int(input())
li = np.zeros(n, dtype=np.int)
ans = 0
i = 1
while i < n:
    ans += (n-1)//i
    i += 1
print(ans)

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

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

Solution (Python):
from collections import defaultdict
from operator import mul
from functools import reduce


def main():
    n = int(input())
    p = [1] * (n + 1)
    for i in range(2, n + 1):
        if p[i] != 1:
            continue
        for j in range(i, n + 1, i):
            if p[j] == 1:
                p[j] = i
    ans = 1
    for i in range(2, n):
        m = i
        k = defaultdict(int)
        while m > p[m]:
            k[p[m]] += 1
            m //= p[m]
        k[m] += 1
        ans += reduce(mul, [e + 1 for e in k.values()])
    print(ans)


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

N, = map(int, input().split())
R = 0
for i in range(1, N+1):
    R += (N-1)//i
print(R)

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

ans = 0

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

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
import math

input = sys.stdin.readline

N = int(input())

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

print(total)

Solution (Python):
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return map(int, readline().rstrip().split())
def i_list(): return list(i_map())


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

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):
from __future__ import division, print_function

import os
import sys
from difflib import SequenceMatcher

 
    
    
from io import BytesIO, IOBase
from collections import Counter,deque
from heapq import heapify,heappush,heappop
from math import gcd,ceil,sqrt,log2,log
from itertools import accumulate,repeat,permutations,compress

from operator import itemgetter
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def rl():
    return list(map(int,input().split()))
def arp(arr):
    return ' '.join([str(i) for i in arr])
    



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


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):

N=int(input())

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

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):
    ans = ans + math.floor((N - 1)/a)
print(ans)

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

Solution (Python):
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
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):
    ans += (N - 1) // a

print(ans)

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

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

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

Solution (Python):

N=int(input())

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

print(ans)

Solution (Python):
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):
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)

Solution (Python):

n = int(input())

ans = 0

a = 1

while a <= n:
 
    if a == 1 :
        ans =  ans + (n - 1)
    else :
        if n % a == 0 :
            ans = ans + ( (n // a) - 1)
        else :
            ans = ans + ( (n // a) )

    a += 1

print(ans)

Solution (Python):
ans=0
n=int(input())
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):
    ans += (n - 1) // a
print(ans)

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

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

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

print(count)

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())
ans = 0
for a in range(1, N):
    ans += (N-1)//a
print(ans)

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

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

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

Solution (Python):
N = int(input())
ans = 0
for a in range(1, N):
  ans += N//a
  if N%a == 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):
def main3():
    N = int(input())
    ans = 0

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

if __name__ == "__main__":
    main3()

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

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

Solution (Python):

import sys,io,os,time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline


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








'''


import collections,sys,threading
sys.setrecursionlimit(10**9)
threading.stack_size(10**8)



threading.Thread(target=solve).start()
'''

Solution (Python):

from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, heapify
import copy
import sys
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)





def LI(): return list(map(int, sys.stdin.buffer.readline().split()))




def I(): return int(sys.stdin.buffer.readline())





def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()




def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')







def IR(n): return [I() for i in range(n)]







def LIR(n): return [LI() for i in range(n)]







def SR(n): return [S() for i in range(n)]







def LSR(n): return [LS() for i in range(n)]







def SRL(n): return [list(S()) for i in range(n)]


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

print(ans)

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

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

print(int(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):
  ans += (n - 1) // a
print(ans)

Solution (Python):
from math import factorial

N = int(input())
ans = 0

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

print(ans)

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

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

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

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

print(ans)

Solution (Python):
from math import sqrt
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]

ans = 0
""" for C in range(1,N):
    ans += len(make_divisors(N-C)) """

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

print(ans)

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

def facrapid(N):
	i=2
	ans=dict()
	div_sum=1
	n=N
	while i*i <=N:
		while n%i==0:
			n=n//i
			if i in ans:
				ans[i]+=1
			else:
				ans[i]=1
		i+=1
	if n!=1:
		ans[n]=1
	
	ans_list=list(ans.items())
	for j in ans_list:
		div_sum*=j[1]+1
	
	return(div_sum)



ans_d={10000: 93643, 20000: 201147, 30000: 313875, 40000: 430027, 50000: 548695, 60000: 669362, 70000: 791730, 80000: 915508, 90000: 1040555, 100000: 1166714, 110000: 1293885, 120000: 1421926, 130000: 1550852, 140000: 1680518, 150000: 1810893, 160000: 1941957, 170000: 2073616, 180000: 2205896, 190000: 2338713, 200000: 2472071, 210000: 2605908, 220000: 2740255, 230000: 2875035, 240000: 3010225, 250000: 3145923, 260000: 3281913, 270000: 3418335, 280000: 3555125, 290000: 3692288, 300000: 3829761, 310000: 3967572, 320000: 4105737, 330000: 4244174, 340000: 4382931, 350000: 4522005, 360000: 4661355, 370000: 4800992, 380000: 4940862, 390000: 5081020, 400000: 5221424, 410000: 5362088, 420000: 5502988, 430000: 5644109, 440000: 5785515, 450000: 5927120, 460000: 6068940, 470000: 6210971, 480000: 6353214, 490000: 6495739, 500000: 6638407, 510000: 6781192, 520000: 6924283, 530000: 7067586, 540000: 7210986, 550000: 7354651, 560000: 7498424, 570000: 7642414, 580000: 7786609, 590000: 7930954, 600000: 8075420, 610000: 8220149, 620000: 8364937, 630000: 8509899, 640000: 8655135, 650000: 8800424, 660000: 8945854, 670000: 9091540, 680000: 9237258, 690000: 9383192, 700000: 9529244, 710000: 9675454, 720000: 9821778, 730000: 9968274, 740000: 10114912, 750000: 10261678, 760000: 10408551, 770000: 10555535, 780000: 10702703, 790000: 10849984, 800000: 10997400, 810000: 11144971, 820000: 11292593, 830000: 11440361, 840000: 11588236, 850000: 11736253, 860000: 11884387, 870000: 12032640, 880000: 12181018, 890000: 12329497, 900000: 12478098, 910000: 12626745, 920000: 12775605, 930000: 12924462, 940000: 13073527, 950000: 13222660, 960000: 13371907, 970000: 13521236, 980000: 13670735, 990000: 13820210, 1000000: 13969985}

n=N//10000

if n>0:
	for i in range(n*10000,n*10000+10000):
		ans_d[i+1]=ans_d[i]+facrapid(i)
	print(ans_d[N])
else:
	ans_d[2]=1
	for i in range(3,10000):
		ans_d[i]=ans_d[i-1]+facrapid(i-1)
	print(ans_d[N])

Solution (Python):
from collections import Counter

class Eratosthenes():  
    def __init__(self, N):  
        self.fact = [i for i in range(N + 1)]
        for i in range(2, int(N ** 0.5) + 1):
            if self.fact[i] < i:
                continue
            for j in range(i ** 2, N + 1, i):
                self.fact[j] = i
        self.prime = [i for i in range(2, N + 1) if i == self.fact[i]]

    def factor(self, NUM):  
        PRIME = []
        while NUM > 1:
            PRIME.append(self.fact[NUM])
            NUM //= self.fact[NUM]
        return Counter(PRIME)

n = int(input())

era = Eratosthenes(n)
ans = 0
for i in range(1, n):
    tmp = 1
    for num in era.factor(i).values():
        tmp *= num + 1
    ans += tmp
print(ans)

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

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:
    if k ** 2 > n:
        break
    er += 1
    k += 1

print((ans * 2) + er)

Solution (Python):
n = int(input())
ans = 0
for a in range(1, n):
    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):
from math import sqrt



def countOrderedPairs(N):
    
    count_pairs = int(0)

    
    p = int(sqrt(N - 1)) + 1
    q = N
    
    for i in range(1, p, 1):
        for j in range(i, q, 1):
            if i * j > N-1:
                break
            
            count_pairs += 1
    
    
    count_pairs *= 2

    
    
    count_pairs -= int(sqrt(N - 1))

    
    return count_pairs

    

N = int(input())
print(countOrderedPairs(N))

Solution (Python):
import math

n = int(input())
count = 0
for i0 in range(n):
    i0 += 1
    count += math.floor(n / i0)
    if n - (math.floor(n / i0) * i0) == 0:
        count -= 1
print(count)

Solution (Python):
def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7


import math
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 divi(n):
    ans = {1}
    for i in range(2,int(n**0.5)+1):
        if n%i == 0:
            ans |= l[i]
            ans |= l[n//i]
    ans.add(n)
    return ans

n = N()
cnt = 1
l = [{} for _ in range(n)]
l[1] = {1}
tab = [0]*(n+1)
for i in range(1,n+1):
    for j in range(i, n + 1, i):
        tab[j] += 1
tab[n]=0
print(sum(tab))

Solution (Python):
import math


def f2(n):
    d = 0
    c = 0
    for i in range(1, n):
        e = 0
        if i * i == n:
            e -= 1
        elif n % i == 0:
            e -= 1
        e += n // i
        d += e

    return d

def main():
    print(f2(int(input())))


if __name__ == '__main__':
    main()

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

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

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



nu=int(input())
total=0
for p in range(1,nu):
    s=collections.Counter(prime_factorize(p))
    sama=1
    for j in s.values():
        sama=sama*(j+1)
    total+=sama
print(total)

Solution (Python):
def make_divisors(n):
    cnt = 0
    i = 1
    while i*i <= n:
        if n % i == 0:
            cnt += 1
            if i != n // i:
                cnt += 1
        i += 1
    return cnt
numbers = [1,10, 100, 1000, 10000, 100000, 150000,200000, 250000,300000,350000, 400000,450000, 500000,550000,600000,630000,675000,700000,720000,750000,800000,825000,850000,875000,900000,912500,925000,950000,975000,987500,1000000]
datas = [0,23,473,7053,93643,1166714, 1810893, 2472071, 3145923, 3829761, 4522005,5221424,5927120,6638407,7354651,8075420,8509899,9164377,9529244,9821778,10261678,10997400,11366472,11736253,12106789,12478098,12664043,12850013,13222660,13595947,13782871,13969985]

N = int(input())
ttl = 0
numPin = 0

for i in range(len(numbers)):
    if N == 1000000:
        numPin = len(numbers) - 1
        break
    if numbers[i] <= N < numbers[i+1]:
        numPin = i
        break

if numPin != len(numbers)-1:
    if N - numbers[numPin] < numbers[numPin + 1] - N:
        for i in range(numbers[numPin], N):
            ttl += make_divisors(i)
        print(ttl + datas[numPin])
    else:
        for i in range(N,numbers[numPin+1]):
            ttl -= make_divisors(i)
        print(ttl + datas[numPin + 1])
else:
    print(datas[numPin])

Solution (Python):
def DivisorsTable(N):
    DivTable = [0]*(N+1) 
    for I in range(1,N+1):
        for J in range(I,N+1,I):
            DivTable[J] += 1
    return sum(DivTable)
print(DivisorsTable(int(input())-1))

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

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

Solution (Python):
def funcion_a(n):
  count = 0
  i = 2
  while i*i <= n:
    count += 1
    j = i + 1
    while i*j <= n:
      count += 2
      j += 1
    i += 1
  return count
  
n = int(input())
answer = funcion_a(n-1) + (n-2)*2 + 1
print(answer)

Solution (Python):

import math

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())
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 a in range(1, N):
  tmp = (N-1) // a
  if a <= (N) // 2:
    count += tmp
  else:
    count += 1          

print(count)

Solution (Python):
import collections

zzz = 1
nn = int(input())
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,nn):
    zzz = 1
    cc = collections.Counter(prime_factorize(i))
    hoge = cc.values()
    for aaa in hoge:
        zzz *= aaa + 1
    ans += zzz
   
print(ans)

Solution (Python):
n=int(input())
s=[n-1]
for i in range(2,n):
    s.append((n-1)//i)
t=0    
for j in s:
    t+=j
print(t)

Solution (Python):
N = int(input())
ans = 0
for i in range(N-1):
    ans += (N-1)//(i+1)
    
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())
a_max=int(n**0.5)+1



s_count=0
d_count=0
for a in range(1,a_max):
    b_max=(n//a)+1
    
    for b in range(a,b_max):
        c=n-a*b
        if c>=1:
            if a==b:
                s_count+=1
            else:
                d_count+=1
           
ans=s_count+d_count*2
print(ans)

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

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())
a=1
x=0
for i in range(n-1):
    x += (n-1)//a
    a += 1
print(x)

Solution (Python):
N = int(input())
NR = int(N**0.5)
count = 0
if int(N/2)-N/2 == 0:
    for i in range(1,int(N/2)):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)
else:
    for i in range(1,int(N/2)+1):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)

count += int(N/2)
print(count)

Solution (Python):
N = int(input())
a = 0
k = 2*(N-2)+1
for i in range(2,N):
    for j in range(i,N):
        if (i*j<N)and(i!=j):
            a+=2
        elif(i*j<N)and(i==j):
            a+=1
        else:
            break
       
print(a+k)

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

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

    count = [0]*(n)

    for i in range(1, n):
        for j in range(i, n, i):
            count[j] += 1
    
    ans = sum(count)
    print(ans)
    
    
    
    
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())
ans=n-1
b=2
while True:
    a=n//b
    if n%b==0:
        a-=1
    ans+=a
    if a==0:
        break
    else:
        b+=1
        if n==b:
            break
print(ans)

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

print (ans)

Solution (Python):

n = int(input())

ans = 0
count = 0

a, b, c = 1, 1, 1

while a <= n:

    
    

    if a == 1 :
        ans =  ans + ( (n // a) - 1)
    else :

        if n // a == 1 :
            ans = ans + 1
        else :

            if n % a == 0 :
                ans = ans + ( (n // a) - 1)
            else :
                ans = ans + ( (n // a) )

            



    
    
    
    

    

    

    

    

    

    
    

    a += 1
    b, c = 1, 1


print(ans - 1)