for i in range(1,n+1):
j=1
while j<=n:
j += 1 #O(n**2)
j += 7 #O(n**2), inner loop does n/7 iterations for each outer loop
j *= 2 #O(n*log(n))
j *= 7 #O(n*log(n)), change log bases is like multiplying by a constant
j **= 2 #O(n*log(log(n))), we need to take a log on both sides *twice* (also for this case, j should start from 2)
j += i #O(n*log(n)), the sum of 1/i from i=1 to n is O(log(n))