A number is termed as star number, if it is a centered figurate number that represents a centered hexagram (six-pointed star) similar to chinese checker game. The few star numbers are 1, 13, 37, 73, 121, 181, 253, 337, 433, ….
Input : n = 2 Output : 13 Input : n = 4 Output : 73 Input : n = 6 Output : 181
If we take few examples, we can notice that the n-th star number is given by the formula:
n-th star number = 6n(n - 1) + 1
Below is the implementation of above formula.
Interesting Properties of Start Numbers:
- The digital root of a star number is always 1 or 4, and progresses in the sequence 1, 4, 1.
- The last two digits of a star number in base 10 are always 01, 13, 21, 33, 37, 41, 53, 61, 73, 81, or 93.
- The generating function for the star numbers is
x*(x^2 + 10*x + 1) / (1-x)^3 = x + 13*x^2 + 37*x^3 +73*x^4 .......
- The star numbers satisfy the linear recurrence equation
S(n) = S(n-1) + 12(n-1)
This article is contributed by DANISH_RAZA . 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
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.
- Program to check if N is a Star Number
- Program to find the Hidden Number
- Program to find the Nth Prime Number
- Program to find the number from given holes
- Program to find the Nth Harmonic Number
- C program to find Decagonal Number
- Program to find the number of men initially
- Program to find the Nth number of the series 2, 10, 24, 44, 70.....
- Program to find the nth Kynea number
- Program to find Cullen Number
- Program to find Nth odd Fibonacci Number
- Program to find the next prime number
- Program to find absolute value of a given number
- Program to find last digit of n'th Fibonnaci Number
- Program to find all Factors of a Number using recursion
- C program to find square root of a given number
- Program to find last two digits of Nth Fibonacci number
- Puzzle | Program to find number of squares in a chessboard
- Program to find remainder when large number is divided by 11
- Program to find remainder when large number is divided by r
Improved By : jit_t