Given an integer N, the task is to find the number of cells in Nth order figure of the given type:
Input: N = 2
Input: N = 3
Approach: It can be observed that for the values of N = 1, 2, 3, … a series will be formed as 1, 5, 13, 25, 41, 61, 85, 113, 145, 181, … whose Nth term will be N2 + (N – 1)2.
Below is the implementation of the above approach:
- Find the number of cells in the table contains X
- Number of cells in matrix which are equidistant from given two points
- Find Number of Even cells in a Zero Matrix after Q queries
- Find the Surface area of a 3D figure
- Check if a number has digits in the given Order
- Biggest number by arranging numbers in certain order
- Tidy Number (Digits in non-decreasing Order)
- Find the sum of the costs of all possible arrangements of the cells
- Largest number smaller than or equal to n and digits in non-decreasing order
- Minimum cells to be flipped to get a 2*2 submatrix with equal elements
- Multiplicative order
- Magic Square | Even Order
- Print Lower Hessenberg matrix of order N
- Maximum sum by picking elements from two arrays in order
- Find the n-th binary string in sorted order
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.