Centered Pentadecagonal Number | Java Program to find nth centered pentadecagonal number ; centered pentadecagonal function ; Formula to calculate nth centered pentadecagonal number ; Driver Code
import java . io . * ; class GFG { static long center_pentadecagonal_num ( long n ) { return ( 15 * n * n - 15 * n + 2 ) / 2 ; } public static void main ( String [ ] args ) { long n = 3 ; System . out . print ( n + " th ▁ number ▁ : ▁ " ) ; System . out . println ( center_pentadecagonal_num ( n ) ) ; n = 10 ; System . out . print ( n + " th ▁ number ▁ : ▁ " ) ; System . out . println ( center_pentadecagonal_num ( n ) ) ; } }