Honaker Prime Number is a prime number P such that the sum of digits of P and sum of digits of index of P is a Prime Number.
Few Honaker Prime Numbers are:
131, 263, 457, 1039, 1049, 1091, 1301, 1361, 1433, 1571, 1913, 1933, 2141, 2221,…
Check if N is a Honaker Prime Number
Given an integer N, the task is to check if N is a Honaker Prime Number or not. If N is an Honaker Prime Number then print “Yes” else print “No”.
Input: N = 131
Sum of digits of 131 = 1 + 3 + 1 = 5
Sum of digits of 32 = 3 + 2 = 5
Input: N = 161
Approach: The idea is to find the index of the given number and check if sum of digits of index and N is the same or not. If it is same then, N is an Honaker Prime Number and print “Yes” else print “No”.
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.
- Find coordinates of a prime number in a Prime Spiral
- Check if a prime number can be expressed as sum of two Prime Numbers
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Count prime pairs whose difference is also a Prime Number
- Count numbers in a given range whose count of prime factors is a Prime Number
- Sum of each element raised to (prime-1) % prime
- Absolute Difference between the Sum of Non-Prime numbers and Prime numbers of an Array
- Absolute difference between the Product of Non-Prime numbers and Prime numbers of an Array
- Check whether the sum of prime elements of the array is prime or not
- Print prime numbers with prime sum of digits in an array
- Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
- Print all numbers whose set of prime factors is a subset of the set of the prime factors of X
- Sum of prime numbers without odd prime digits
- Permutation of first N positive integers such that prime numbers are at prime indices
- Permutation of first N positive integers such that prime numbers are at prime indices | Set 2
- Count all prime numbers in a given range whose sum of digits is also prime
- Count prime numbers that can be expressed as sum of consecutive prime numbers
- Number of factors of very large number N modulo M where M is any prime number
- Super Ugly Number (Number whose prime factors are in given set)
- Number with maximum number of prime factors
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.