Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
from collections import OrderedDict, defaultdict
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

def run():
    N = int(input())
    primes = [2]

    for i in range(3, int(N ** (0.5))+1):
        done = False
        for k in primes:
            if not i % k:
                done = True
                break
        if not done:
            primes.append(i)
    #print(primes)

    ret = 1# f(1) = 1

    for i in range(2, N+1):
        current = i
        dic = defaultdict(lambda:(0))
        eval_max = int(i ** (0.5))
        for p in primes:
            if p > eval_max:
                break
            j = 1
            q = p
            x = 0
            while True:
                if not current % q:
                    j *= 2
                    q = p ** j
                else:
                    j = j // 2
                    q = p ** j
                    if j == 0:break
                    if not current % q:
                        current = current // q
                        x += j
                dic[p] = x
        if current != 1:
            dic[current] += 1
        tmp = 1
        for key in dic.keys():
            tmp *= dic[key] + 1
        #print(dic, tmp)
        ret += tmp * i

    print(ret)


if __name__ == "__main__":
    run()

Fixed submission:
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
from collections import OrderedDict, defaultdict
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

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

    ret = 0
    for i in range(1,N+1):
        tmp = N // i
        left = i
        right = i * tmp
        ret += (left + right) * tmp // 2
    print(ret)
if __name__ == "__main__":
    run()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
from collections import OrderedDict, defaultdict
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

def run():
    N = int(input())
    primes = [2]

    for i in range(3, int(N ** (0.5))+1):
        done = False
        for k in primes:
            if not i % k:
                done = True
                break
        if not done:
            primes.append(i)
    #print(primes)

    ret = 1# f(1) = 1

    for i in range(2, N+1):
        current = i
        dic = defaultdict(lambda:(0))
        eval_max = int(i ** (0.5))
        for p in primes:
            if p > eval_max:
                break
            while True:
                if not current % p:
                    current = current // p
                    dic[p] += 1
                else:break
        if current != 1:
            dic[current] += 1
        tmp = 1
        for key in dic.keys():
            tmp *= dic[key] + 1
        #print(dic, tmp)
        ret += tmp * i

    print(ret)


if __name__ == "__main__":
    run()

Fixed submission:
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
from collections import OrderedDict, defaultdict
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

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

    ret = 0
    for i in range(1,N+1):
        tmp = N // i
        left = i
        right = i * tmp
        ret += (left + right) * tmp // 2
    print(ret)
if __name__ == "__main__":
    run()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
from collections import OrderedDict, defaultdict
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

def run():
    N = int(input())
    primes = [2]

    for i in range(3, int(N ** (0.5))+1):
        done = False
        for k in primes:
            if not i % k:
                done = True
                break
        if not done:
            primes.append(i)
    #print(primes)

    ret = 1# f(1) = 1

    for i in range(2, N+1):
        current = i
        dic = defaultdict(lambda:(0))
        eval_max = int(i ** (0.5))
        for p in primes:
            if p > eval_max:
                break
            while True:
                if not current % p:
                    current = current // p
                    dic[p] += 1
                else:break
        if current != 1:
            dic[current] += 1
        tmp = 1
        for key in dic.keys():
            tmp *= dic[key] + 1
        #print(dic, tmp)
        ret += tmp * i

    print(ret)


if __name__ == "__main__":
    run()

Fixed submission:
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
from collections import OrderedDict, defaultdict
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

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

    ret = 0
    for i in range(1,N+1):
        tmp = N // i
        left = i
        right = i * tmp
        ret += (left + right) * tmp // 2
    print(ret)
if __name__ == "__main__":
    run()