Given a number N. The task is to write a program to find the Nth term in the below series:

3, 14, 39, 84…

**Examples:**

Input:3Output:39 For N = 3 Nth term = ( 3*3*3 ) + ( 3*3 ) + 3 = 39Input:4Output:84

Formula to calculate the Nth term of the series:

Nth term = ( N*N*N ) + ( N*N ) + N

Below is the required implementation:

## C++

`// CPP program to find N-th term of the series: ` `// 3, 14, 38, 84... ` `#include <iostream> ` `using` `namespace` `std; ` ` ` `// calculate Nth term of series ` `int` `nthTerm(` `int` `N) ` `{ ` ` ` `return` `(N * N * N) + (N * N) + N; ` `} ` ` ` `// Driver Function ` `int` `main() ` `{ ` ` ` `int` `N = 3; ` ` ` ` ` `cout << nthTerm(N); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java program to find Nth number ` `import` `java.io.*; ` ` ` `// calculate Nth term of this series ` `class` `GFG ` `{ ` `public` `int` `nthTerm(` `int` `N) ` `{ ` ` ` `// By using above formula ` ` ` `return` `(N * N * N) + (N * N) + N; ` `} ` ` ` `// Driver Code ` `public` `static` `void` `main(String[] args) ` `{ ` ` ` `int` `N = ` `3` `; ` ` ` `GFG a = ` `new` `GFG(); ` ` ` ` ` `// call and print Nth term ` ` ` `System.out.println(a.nthTerm(N)); ` `} ` `} ` |

*chevron_right*

*filter_none*

## Python 3

`# Python 3 program to find N-th ` `# term of the series: ` `# 3, 14, 38, 84... ` ` ` `# Function to calculate Nth term of series ` `def` `nthTerm(n) : ` ` ` ` ` `return` `(N ` `*` `N ` `*` `N) ` `+` `(N ` `*` `N) ` `+` `N ` ` ` `# Driver code ` `if` `__name__ ` `=` `=` `"__main__"` `: ` ` ` ` ` `N ` `=` `3` ` ` ` ` `# function calling ` ` ` `print` `(nthTerm(N)) ` ` ` `# This code is contributed by ANKITRAI1 ` |

*chevron_right*

*filter_none*

## C#

`// C# program to find Nth number ` `using` `System; ` ` ` `// calculate Nth term of this series ` `class` `GFG ` `{ ` `public` `int` `nthTerm(` `int` `N) ` `{ ` ` ` `// By using above formula ` ` ` `return` `(N * N * N) + (N * N) + N; ` `} ` ` ` `// Driver Code ` `public` `static` `void` `Main() ` `{ ` ` ` `int` `N = 3; ` ` ` `GFG a = ` `new` `GFG(); ` ` ` ` ` `// call and print Nth term ` ` ` `Console.WriteLine(a.nthTerm(N)); ` `} ` `} ` ` ` `// This code is contributed ` `// by inder_verma. ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP program to find N-th term ` `// of the series: 3, 14, 38, 84... ` ` ` `// calculate Nth term of series ` `function` `nthTerm(` `$N` `) ` `{ ` ` ` `return` `(` `$N` `* ` `$N` `* ` `$N` `) + ` ` ` `(` `$N` `* ` `$N` `) + ` `$N` `; ` `} ` ` ` `// Driver Code ` `$N` `= 3; ` ` ` `echo` `nthTerm(` `$N` `); ` ` ` `// This code is contributed ` `// by Shivi_Aggarwal ` `?> ` |

*chevron_right*

*filter_none*

**Output:**

39

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Nth term where K+1th term is product of Kth term with difference of max and min digit of Kth term
- Find the Nth term of the series where each term f[i] = f[i - 1] - f[i - 2]
- Find Nth term of the series where each term differs by 6 and 2 alternately
- Nth term of a sequence formed by sum of current term with product of its largest and smallest digit
- Nth term of given recurrence relation having each term equal to the product of previous K terms
- Program to find Nth term in the given Series
- Program to find the Nth term of the series 3, 7, 13, 21, 31.....
- Program to find Nth term of series 1, 3, 12, 60, 360…
- Program to find the Nth term of series -1, 2, 11, 26, 47......
- Program to find Nth term in the series 0, 0, 2, 1, 4, 2, 6, 3, 8,...
- Program to find Nth term of series 9, 23, 45, 75, 113...
- Program to find Nth term in the series 0, 2, 1, 3, 1, 5, 2, 7, 3,…
- Find Nth term of series 1, 4, 15, 72, 420...
- Find Nth term of the series 5, 13, 25, 41, 61...
- Program to find the Nth term of the series 3, 20, 63, 144, 230, ……
- Program to find the Nth term of series 5, 10, 17, 26, 37, 50, 65, 82, ...
- Program to find the Nth term of series 0, 4, 14, 30, 51, 80, 114, 154, 200, ...
- Program to find the Nth term of the series 0, 14, 40, 78, 124, ...
- Program to find the Nth term of the series 0, 5, 14, 27, 44, ........
- Find Nth term of the series 1, 8, 54, 384...

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.