<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described.
<END_TASK>
<USER_TASK:>
Description:
Nicomachusâ €™ s Theorem ( Sum of k
Return the sum of k - th group of positive odd integers . ; Finding first element of kth group . ; Finding the sum . ; Driver code

<ASSISTANT_TASK:>
Python Code:
def kthgroupsum(k ) : 
	 cur = int(( k *(k - 1 ) ) + 1 ) 
 sum = 0 
 while k : 
	 sum += cur 
 cur += 2 
 k = k - 1 
  return sum 
  k = 3 
 print(kthgroupsum(k ) ) 

<END_TASK>
