Print n numbers such that their sum is a perfect square | Java implementation of the approach ; Function to print n numbers such that their sum is a perfect square ; Print ith odd number ; Driver code
class GFG { static void findNumbers ( int n ) { int i = 1 ; while ( i <= n ) { System . out . print ( ( ( 2 * i ) - 1 ) + " ▁ " ) ; i ++ ; } } public static void main ( String args [ ] ) { int n = 3 ; findNumbers ( n ) ; } }