Keith number
Is it possible to make a program in java to check whether the entered number is keith number or not without using array? A n digit number x is called Keith number if it appears in a special sequence (defined below) generated using its digits. The special sequence has first n terms as digits of x and other terms are recursively evaluated as sum of previous n terms. Input : x = 197 Output : Yes 197 has 3 digits, so n = 3 The number is Keith because it appears in the special sequence that has first three terms as 1, 9, 7 and remaining terms evaluated using sum of previous 3 terms. 1, 9, 7, 17, 33, 57, 107, 197, ..... Input : x = 12 Output : No The number is not Keith because it doesn't appear in the special sequence generated using its digits. 1, 2, 3, 5, 8, 13, 21, ..... Input : x = 14 Output : Yes 14 is a Keith number since it appears in the sequence, 1, 4, 5, 9, 14, ...