Program to print pentatope numbers upto Nth term | Java program to print Pentatope number series . ; Function to print pentatope series up to nth term ; Loop to print pentatope number series ; calculate and print ith pentatope number ; Driver code ; Function call to print pentatope number series
import java . io . * ; class GFG { static void printSeries ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { int num = ( i * ( i + 1 ) * ( i + 2 ) * ( i + 3 ) / 24 ) ; System . out . print ( num + " ▁ " ) ; } } public static void main ( String [ ] args ) { int n = 10 ; printSeries ( n ) ; } }