Write a program to find the following series upto n terms:
3,18,83...
Answers
Answered by
1
Answer:
import java.util.*;
public class Series
{
public static void main(String args[ ])
{
Scanner in=new Scanner (System. in);
int a,c,n;
System.out.println("Enter the value of n");
n=in.nextInt();
for(a=1;a<=n;a++)
{
c=Math.pow(a,4)+2;
System.out.println("The series is ="+c);
}
}
Explanation:
In the given series it is the additive result of 2 with the 4 to the power of the numbers.
Such that,
(1×1×1×1)+2
=1+2
=3
(2×2×2×2)+2
=16+2
=18
(3×3×3×3)+2
=81+2
=83
And vice versa.
Similar questions
English,
5 months ago
Science,
5 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago