Buggy python submission (verdict: Time Limit Exceeded):
import math as mt 
import collections
N = int(raw_input())
MAX_SIZE = N+1
  
# stores smallest prime factor for 
# every number 
# Python3 program to generate all 
# prime numbers less than N in O(N) 


# isPrime[] : isPrime[i] is true if 
#			 number is prime 
# prime[] : stores all prime number 
#		 less than N 
# SPF[] that store smallest prime 
# factor of number [for ex : smallest 
# prime factor of '8' and '16' 
# is '2' so we put SPF[8] = 2 , 
# SPF[16] = 2 ] 
isprime = [True] * MAX_SIZE 
prime = [] 
SPF = [None] * (MAX_SIZE) 

# function generate all prime number 
# less then N in O(n) 
def manipulated_seive(N): 

	# 0 and 1 are not prime 
	isprime[0] = isprime[1] = False

	# Fill rest of the entries 
	for i in range(2, N): 
	
		# If isPrime[i] == True then i is 
		# prime number 
		if isprime[i] == True: 
		
			# put i into prime[] vector 
			prime.append(i) 

			# A prime number is its own smallest 
			# prime factor 
			SPF[i] = i 
		
		# Remove all multiples of i*prime[j] 
		# which are not prime by making is 
		# Prime[i * prime[j]] = false and put 
		# smallest prime factor of i*Prime[j] 
		# as prime[j] [ for exp :let i = 5 , j = 0 , 
		# prime[j] = 2 [ i*prime[j] = 10 ] 
		# so smallest prime factor of '10' is '2' 
		# that is prime[j] ] this loop run only one 
		# time for number which are not prime 
		j = 0
		while (j < len(prime) and
			i * prime[j] < N and
				prime[j] <= SPF[i]): 
		
			isprime[i * prime[j]] = False

			# put smallest prime factor of i*prime[j] 
			SPF[i * prime[j]] = prime[j] 
			
			j += 1
		

# A O(log n) function returning prime  
# factorization by dividing by smallest  
# prime factor at every step 
def getFac(x): 
    count=0
    ret = collections.Counter()
    while (x != 1): 
        ret[SPF[x]]+=1
        count+=1
        x //= SPF[x]
    return ret , count


manipulated_seive(MAX_SIZE)
ans = 0
for i in range(1,N+1):
    fac, count = getFac(i)
    tmp = 1
    for v in fac.values():
        tmp *= (v+1)
    ans += tmp*i
print(ans)

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


#26879

Buggy python submission (verdict: Time Limit Exceeded):
import math as mt 
import collections
N = int(raw_input())
MAXN = N+1
  
# stores smallest prime factor for 
# every number 
spf = [0 for i in range(MAXN)] 
  
# Calculating SPF (Smallest Prime Factor)  
# for every number till MAXN. 
# Time Complexity : O(nloglogn) 
def sieve(): 
    spf[1] = 1
    for i in range(2, MAXN): 
          
        # marking smallest prime factor  
        # for every number to be itself. 
        spf[i] = i 
  
    # separately marking spf for  
    # every even number as 2 
    for i in range(4, MAXN, 2): 
        spf[i] = 2
  
    for i in range(3, int(mt.ceil(mt.sqrt(MAXN)))): 
          
        # checking if i is prime 
        if (spf[i] == i): 
              
            # marking SPF for all numbers 
            # divisible by i 
            for j in range(i * i, MAXN, i):  
                  
                # marking spf[j] if it is  
                # not previously marked 
                if (spf[j] == j): 
                    spf[j] = i 
# A O(log n) function returning prime  
# factorization by dividing by smallest  
# prime factor at every step 
def getFac(x): 
    count=0
    ret = collections.Counter()
    while (x != 1): 
        ret[spf[x]]+=1
        count+=1
        x //= spf[x]
    return ret , count


sieve() 
ans = 0
for i in range(1,N+1):
    fac, count = getFac(i)
    tmp = 1
    for v in fac.values():
        tmp *= (v+1)
    ans += tmp*i
print(ans)

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


#26879

Buggy python submission (verdict: Time Limit Exceeded):
import math as mt 
import collections
N = int(raw_input())
MAXN = N+1
  
# stores smallest prime factor for 
# every number 
spf = [0 for i in range(MAXN)] 
  
# Calculating SPF (Smallest Prime Factor)  
# for every number till MAXN. 
# Time Complexity : O(nloglogn) 
def sieve(): 
    spf[1] = 1
    for i in range(2, MAXN): 
          
        # marking smallest prime factor  
        # for every number to be itself. 
        spf[i] = i 
  
    # separately marking spf for  
    # every even number as 2 
    for i in range(4, MAXN, 2): 
        spf[i] = 2
  
    for i in range(3, int(mt.ceil(mt.sqrt(MAXN)))): 
          
        # checking if i is prime 
        if (spf[i] == i): 
              
            # marking SPF for all numbers 
            # divisible by i 
            for j in range(i * i, MAXN, i):  
                  
                # marking spf[j] if it is  
                # not previously marked 
                if (spf[j] == j): 
                    spf[j] = i 
# A O(log n) function returning prime  
# factorization by dividing by smallest  
# prime factor at every step 
def getFac(x): 
    ret = list() 
    while (x != 1): 
        ret.append(spf[x]) 
        x = x // spf[x] 
  
    return ret 


sieve() 
ans = 0
for i in range(1,N+1):
    fac = getFac(i)
    if len(fac) == 1:
        ans += i*2
    else:
        res = 1
        dic = collections.Counter(fac)
        for v in dic.values():
            res*=(v+1)
        ans+= res*i
print(ans)

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


#26879