Print N numbers such that their sum is a Perfect Cube | Java implementation to find the N numbers such that their sum is a perfect cube ; Function to find the N numbers such that their sum is a perfect cube ; Loop to find the Ith term of the Centered Hexagonal number ; Driver Code ; Function Call
class GFG { static void findNumbers ( int n ) { int i = 1 ; while ( i <= n ) { System . out . print ( ( 3 * i * ( i - 1 ) + 1 ) + " ▁ " ) ; i ++ ; } } public static void main ( String [ ] args ) { int n = 4 ; findNumbers ( n ) ; } }