Pentagonal Pyramidal Number | Java Program to get nth Pentagonal pyramidal number . ; function to get nth Pentagonal pyramidal number . ; Driver Code
import java . io . * ; class GFG { static int pentagon_pyramidal ( int n ) { return n * n * ( n + 1 ) / 2 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( pentagon_pyramidal ( n ) ) ; } }