Math, asked by Manishbottu1752, 1 year ago

A sequence 1,1,2,3,4,9,8,27,16,81,32,243,64,729,128,2187.... above is of two series one is made of odd nos. and other is of even nos. we have to find the nth number in series given n is input,output is nth number in series

Answers

Answered by valetta
12

Answer:

nth term of the sequence = 2ⁿ⁻¹ , 3ⁿ⁻¹

Explanation:

1,1,2,3,4,9,8,27,16,81,32,243,64,729,128,2187....

Here two sequences are given:

Sequence 1 : -    1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 ,  ........

nth term of the Sequence 1 is -   T_{n} = a*rⁿ⁻¹   = 1*(2)ⁿ⁻¹   = 2ⁿ⁻¹

Sequence 2: -

1 , 3 , 9 , 27 , 81 , 243 , 729 , 2187 , .........

T_{n} = a*rⁿ⁻¹ = 1*3ⁿ⁻¹ = 3ⁿ⁻¹

So the nth term of the series :

1 , 1 , 2 , 3 , 4 , 9 , 8 , 27 , 16 , 81 , 32 , 243 ,64 , 729 , 128 , 2187 ,.............2ⁿ⁻¹ , 3ⁿ⁻¹

That's the final answer.

I hope it will help you.

Answered by areeb5003
7

//java program to find the nth number for the given odd even geometric progression series is:

import java.lang.Math;

import java.util.Scanner;

class Pattern4 {

static void value(double n) {

if(n%2==1)

{int x=0;

double term_in_series=(n+1)/2;

double r=Math.pow(2,term_in_series-1);

x=(int) r;

System.out.print(x);

}

if(n%2==0) {

int y=0;

double term_in_series=n/2;

double b=Math.pow(3,term_in_series-1);

y=(int) b;

System.out.print(y+" ");

}

}

public static void main(String args[]) {

Scanner sc=new Scanner(System.in);

double n=sc.nextDouble();

value(n);

}

}

//Submitted by Areeb Ali

Similar questions