Sum of fourth powers of the first n natural numbers | Java Program to find the sum of forth powers of first n natural numbers ; Return the sum of forth power of first n natural numbers ; Driven Program
import java . io . * ; import java . util . * ; class GFG { static long fourthPowerSum ( int n ) { return ( ( 6 * n * n * n * n * n ) + ( 15 * n * n * n * n ) + ( 10 * n * n * n ) - n ) / 30 ; } public static void main ( String [ ] args ) { int n = 6 ; System . out . println ( fourthPowerSum ( n ) ) ; } }