Print n numbers such that their sum is a perfect square | C ++ implementation of the approach ; Function to print n numbers such that their sum is a perfect square ; Print ith odd number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findNumbers ( int n ) { int i = 1 ; while ( i <= n ) { cout << ( ( 2 * i ) - 1 ) << " ▁ " ; i ++ ; } } int main ( ) { int n = 3 ; findNumbers ( n ) ; }