# Puzzle 32) The Lucky Number

Submitted by Abhishek Jain, on October 01, 2017

**Puzzle**

Anuj, an intelligent boy discovers some new numbers named them as The Lucky Numbers. These numbers has the following special characteristics:

- They are of Four Digits.
- When number divided into two half’s that is, two digit on one side and remaining two on other side, then the square of sum of two half’s is equal to the original number.
- All the digits of the lucky number should be alike or different.

As an example, 3025 is a lucky number.The two half’s are 30 and 25.Thus, 30 added to 25 is 55, and 55 multiplied by 55 is 3025. Curious, is it not?

Now, Anuj needs your help to find another lucky number, composed of four figures, all alike, which may be divided from the middle and produce the same result.

**Answer**

**9801**

**Explanation**

The required Lucky Number is 9,801. If we divide this from the middle into two numbers and add them together we get 99, which, upon squaring give 9,801.

It is true that 2,025 may be treated in the same way, only this number is excluded by the condition which requires that no two figures should be alike.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.