Problem:
 Score : 400 points    Problem Statement For a positive integer X , let f(X) be the number of positive divisors of X .  Given a positive integer N , find \sum_{K=1}^N K\times f(K) .      Constraints  1 \leq N \leq 10^7         Input Input is given from Standard Input in the following format:  N       Output Print the value \sum_{K=1}^N K\times f(K) .        Sample Input 1 4      Sample Output 1 23  We have f(1)=1 , f(2)=2 , f(3)=2 , and f(4)=3 , so the answer is 1\times 1 + 2\times 2 + 3\times 2 + 4\times 3 =23 .       Sample Input 2 100      Sample Output 2 26879       Sample Input 3 10000000      Sample Output 3 838627288460105  Watch out for overflows.

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

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

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

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

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


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

Solution (Python):
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
N = rri()
ans= 0
for i in range(1, N+1):
    first = i
    last = i*(N//i)
    ans += (last+first)*(N//i)/2
print(ans)

Solution (Python):
n=int(input())
List=[2 for x in range(n+1)]
List[0]=0
List[1]=1
ans=1
 
for x in range(2,n+1):
  for y in range(2*x,n+1,x):
    List[y]+=1
  ans+=x*List[x]
print(ans)

Solution (Python):
n=int(input())
List=[2 for x in range(n+1)]
List[0]=0
List[1]=1
ans=1

for x in range(2,n+1):
  for y in range(2*x,n+1,x):
    List[y]+=1
  ans+=x*List[x]
print(ans)

Solution (Python):
def g(x):
    return (x*(x+1))//2
    
n = int(input())
ans = 0

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

Solution (Python):
N=int(input())
print(sum(i*(N//i)*(N//i+1)//2 for i in range(1,N+1)))

Solution (Python):
N=int(input())
ans=sum(2*i for i in range(N+1))

j=2
while j<=N:
    k=2
    while j*k<=N:
        ans+=j*k
        k+=1
    j+=1

print(ans-1)

Solution (Python):

def make_eratosthenes(n):
    A=[0]*n
    A[0],A[1]=-1,-1 
    for i in range(2,n):
        if A[i]==0:
            j=i
            while j<n:
                A[j]=i
                j+=i
    return A

n=int(input())
E=make_eratosthenes(n+5)
C=[0]*(n+5)
C[1]=1
D=[0]*(n+5) 
for i in range(2,n+5):
    e=i//E[i]
    if e==1:
        C[i]=2
        D[i]=1
    else:
        if E[e]==E[i]:
            C[i]=C[e]+D[e]
            D[i]=D[e]
        else:
            C[i]=C[e]*2
            D[i]=C[e]
ans=0
for i in range(n+1):
    ans+=i*C[i]
print(ans)

Solution (Python):
from numba import njit

@njit("i8(i8)")
def solve(n):
    s = [1] * (n+1)
    ans = 1
    for i in range(2,n+1):
        for j in range(i,n+1,i):
            s[j] += 1
        ans += (i * s[i])
    return ans
n = int(input()) 
print(solve(n))

Solution (Python):
from numba import njit
import numpy as np


@njit("i8(i8)")
def solve(n):
    ans = 1
    res = np.ones(n + 1, dtype=np.int64)
    for i in range(2, n + 1):
        for j in range(i, n + 1, i):
            res[j] += 1
        ans += i * res[i]
    return ans


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

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

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

Solution (Python):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()

N=int(input())
c=0
for i in range(1,N+1):
    a=N//i
    c+=i*a*(a+1)//2
print(c)

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

def calc(b, e):
    
    cnt = e // b
    return (b + e) * cnt // 2

ans = 0

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

print(ans)

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

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

Solution (Python):


n = int(input())




s = sum(m * (n // m) * (n // m + 1) // 2 for m in range(1, n + 1))
print(s)

Solution (Python):


n = int(input())




s = sum(m * (n // m) * (n // m + 1) // 2 for m in range(1, n + 1))
print(s)

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

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

res = 0

for i in range(1, N+1):
    j = N // i
    res += j*(j+1)*i//2
print(res)

Solution (Python):
n = int(input())
a = n * (n+1) // 2
for i in range(2, n+1):
  c = n // i
  a += i * (c * (c+1) // 2)
print(a)

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

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

Solution (Python):
def main():
    n = int(input())
    y = [0]*(n+1)
    res = 0
    for i in range(1,n+1):
        j = 1
        while True:
            if i*j > n:
                break
            y[i*j] += 1
            j += 1
        res += i*y[i]
    print(res)

if __name__ == '__main__':
    main()

Solution (Python):
import sys







input = sys.stdin.readline
sys.setrecursionlimit(10**7)
inf = 10**17
mod = 10**9 + 7


n = int(input())
def f(n): return n*(n+1)//2
ans = 0
for i in range(1,n+1):
    x=n//i
    ans+=i*f(x)

print(ans)

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

count = 0
for i in range(1, N+1):
    u = N // i
    count += u * (1 + u) // 2 * i

print(count)

Solution (Python):
import sys







input = sys.stdin.readline
sys.setrecursionlimit(10**7)
inf = 10**17
mod = 10**9 + 7


n = int(input())
def f(n): return n*(n+1)//2
ans = 0
for i in range(1,n+1):
    x=n//i
    ans+=i*f(x)

print(ans)

Solution (Python):
n = int(input())
ans=0
def formula(n):
   return n * (n+1) //2
for i in range(1,n+1):
   x=n//i
   ans+=i*formula(x)
print(ans)

Solution (Python):
import math
n = int(input())
x = math.floor(math.sqrt(n))
ans = 0
for m in range(1,x+1):
    ans += m*(m+math.floor(n/m))*(math.floor(n/m)+1-m)
print(int(ans-(((x+1)**4-x**4)-((x+1)**2-x**2))/12))

Solution (Python):
import math
def solver(n):
    sum = 0
    for i in range(1,n+1):
        y = math.floor(n/i)
        sum+=(i*y*(y+1)/2)
    return int(sum)


n = int(input())
print(solver(n))

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

ans = 0
for i in range(1,N+1):
    m, M = i, N - N%i
    ans += (m+M) * ((M-m)//i + 1) // 2

print(ans)

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

for n in range(N):
	d = N//(n+1)
	r += d*(d+1)*(n+1)//2
print(r)

Solution (Python):
from numba import njit
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

@njit
def main(N):
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    N = int(readline())
    main(N)

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

def main(N):
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    N = int(readline())
    main(N)

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

def main(N):
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    N = int(readline())
    main(N)

Solution (Python):


n = int(input())



def f(n):
    ret = 0
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            ret += j

    return ret


ans = f(n)
print(ans)

Solution (Python):
from numba import njit

n = int(input())


@njit
def f(n):
    ret = 0
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            ret += j

    return ret


ans = f(n)
print(ans)

Solution (Python):
N = int(input())
 
def num_divisors_table(N):
    ans = 0
    for i in range(1, N + 1):
        u = i
        t = i * (N // i)
        n = N // i
        ans += (u + t) * n // 2
    
    return ans

print(num_divisors_table(N))

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

print(num_divisors_table(N))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N = int(readline())
    f = [0 for _ in range(N+1)]
    for i in range(1, N+1):
        j = i
        while j <=N:  
            f[j] += 1
            j += i
    ans = 0
    for i in range(1, N+1):
        ans += i*f[i]
    print(ans)
if __name__ == '__main__':
    main()

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

def main(N):
    ans = N * (N + 1) // 2

    for n in range(1,N+1):
        for i in range(2*n, N+1, n):
            ans += i

    print(ans)


if __name__ == "__main__":
    N = int(readline())
    main(N)

Solution (Python):
N = int(input())
divisors = [0] * N
ans = 0
for i in range(N):
    num = i+1
    for j in range(i, N, num):
        divisors[j] += 1
    ans += num * divisors[i]
print(ans)

Solution (Python):
from numba import njit
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

@njit
def main(N):
    ans = N * (N + 1) // 2

    for n in range(1,N+1):
        for i in range(2*n, N+1, n):
            ans += i

    print(ans)


if __name__ == "__main__":
    N = int(readline())
    main(N)

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

Solution (Python):


import re
import math
from collections import defaultdict,deque,Counter
from fractions import Fraction
import bisect
import itertools
from itertools import accumulate
from copy import deepcopy
import heapq
import random
import time
import os
import sys
from functools import lru_cache,reduce
readline=sys.stdin.readline
sys.setrecursionlimit(100000)
alp="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Set():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(bool)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        if not self.find(x):
            heapq.heappush(self.heap,x)
            self.dic[x]=True
            self.size+=1

    def remove(self,x):
        if self.find(x):
            self.dic[x]=False
            self.size-=1

    def find(self,x):
        return self.dic[x]
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==False:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class multiset():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(int)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        heapq.heappush(self.heap,x)
        self.dic[x]+=1
        self.size+=1

    def remove(self,x):
        if self.dic[x]>0:
            self.dic[x]-=1
            self.size-=1
    
    def count(self,x):
        return self.dic[x]

    def find(self,x):
        return self.dic[x]>0
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==0:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):print("yes" if b else "no")
def Yn(b):print("Yes" if b else "No")
def YN(b):print("YES" if b else "NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(b,t,f):return t if b else f
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def inputintlist(row=1): 
    if row==1:
        ret=list(map(int,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=int(input())
    return ret
def inputfloatlist(row=1): 
    if row==1:
        ret=list(map(float,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=float(input())
    return ret
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def getmd(x1,y1,x2,y2):return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow
def zipsort(*args):
    ziplist=sorted(zip(*args))
    for a in range(len(args)):
        for b in range(len(ziplist)):
            args[a][b]=ziplist[b][a]
def zipreverse(*args):
    ziplist=list(zip(*args))
    rev=[]
    for a in range(len(ziplist)-1,-1,-1):
        rev.append(ziplist[a])
    for a in range(len(args)):
        for b in range(len(rev)):
            args[a][b]=rev[b][a]


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

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

Solution (Python):
from numba import njit
from math import sqrt
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

@njit
def main(N):
    table = [1] * (N + 1)

    for n in range(2,N):
        for i in range(2*n, N+1, n):
            table[i] += 1
    
    ans = 0
    for i in range(1, N+1):
        ans += i * (table[i] + 1)
    
    print(ans - 1)


if __name__ == "__main__":
    N = int(readline())
    main(N)

Solution (Python):
import numpy as np
from numba import njit


@njit
def solve(N):
    ans = 0
    for i in range(1, N + 1):
        ans += (i + i * (N // i)) * (N // i) // 2
    return ans


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

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

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

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

print(ans)

Solution (Python):
import numpy as np

def solve(stdin):
    n = stdin[0]
    dp = np.zeros(n+1,dtype=np.int64)
    for i in range(1,n+1):
        for j in range(i,n+1,i):
            dp[j]+=1
    dp*=np.arange(n+1)
    return dp.sum()

def main():
    stdin = np.fromstring(open(0).read(), dtype=np.int64, sep=' ')
    print(solve(stdin))

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', '(i8[:],)')(solve)
    cc.compile()

if __name__ == '__main__':
    import sys
    if sys.argv[-1] == 'ONLINE_JUDGE':
        cc_export()
        exit(0)
    from my_module import solve
    main()

Solution (Python):
def main():
    n = int(input())
    l = [0 for _ in range(n + 1)]
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            l[j] += 1
    answer = 0
    for i in range(n + 1):
        answer += i * l[i]
    print(answer)


if __name__ == '__main__':
    main()

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


def main():
    N = int(input().strip())
    ans = 0
    for i in range(1,N+1):
        for j in range(i,N+1,i):
            ans += j
    return ans

if __name__ == "__main__":
    print(main())

Solution (Python):

N = int(input())
f = [0] * (N+1)
for i in range(1, N+1):
  for j in range(i, N+1, i):
    f[j] += 1

ans = 0
for i in range(1, N+1):
  ans += f[i] * i
print(ans)

Solution (Python):
import collections

n = int(input())

f = [1] * (n + 1)
for i in range(2, n + 1):
    if f[i] != 1: continue
    m = i
    while m <= n:
        tmp = m
        cnt = 0
        while tmp % i == 0:
            tmp = tmp // i
            cnt += 1
        f[m] *= cnt + 1
        m += i

ans = 0
for i in range(1, n + 1):
    ans += i * f[i]
print(ans)

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

ans = 0
for k in range(1, N + 1):
    n = N // k
    ans += n * (2 * k + (n - 1) * k) // 2

print(ans)

Solution (Python):
n = int(input())
def g(x):
    return x*(x+1)//2
ans = 0
for i in range(1, n+1):
    ans += i*g(n//i)
print(ans)

Solution (Python):

import sys
import math


def solve(N: int):
    answer = 0
    for i in range(1, N+1):
        ratio = N // i
        answer += i * (ratio * (ratio + 1)) // 2
    print(answer)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
def g(x):
    return x*(x+1)//2
ans = 0
for i in range(1, n+1):
    ans += i*g(n//i)
print(ans)