
superEven2
Let a number be supereven if all of its digits are even, and its digital root is also even.
Here are the first few supereven non-negative integers:0, 2, 4, 6, 8, 20, 22, 24, 26, 40, ...
Given an integer n
, find the nth
(1-based) supereven integer.
Example:
- For
n = 7
, the output should besuperEven2(n) = 22
.
The7th
supereven non-negative integer is22
, since2
and2+2=4
are both even.
Input/Output
-
[execution time limit] 0.5 seconds
-
[input] integer n
The 1-based index of the superevennumber.
Constraints:
1 ≤ n ≤ 105
. -
[output] integer
Post Comment