human
Sum of all i such that ( 2 ^ i + 1 ) % 3 = 0 where i is in range [ 1 , n ] | Function to return the required sum.
Total odd numbers from 1 to n.
Sum of first n odd numbers.
Driver code"
How can the above be solved in Python?
 What is a code to sum of all i such that ( 2 ^ i + 1 ) % 3 = 0 where i is in range [ 1 , n ] and the other steps required?
assistant
#Here is code to sum of all i such that ( 2 ^ i + 1 ) % 3 = 0 where i is in range [ 1 , n ] and the other steps required.
 def sumN ( n ) :
	n = ( n + 1 ) // 2 ;
	return ( n * n ) ;
n = 3 ;
print ( sumN ( n ) ) ;