*This kata is inspired by [Project Euler Problem #387](https://projecteuler.net/problem=387)*
---
A [Harshad number](https://en.wikipedia.org/wiki/Harshad_number) (or Niven number) is a number that is divisible by the sum of its digits. A *right truncatable Harshad number* is any Harshad number that, when recursively right-truncated, results in a Harshad number at each truncation. By definition, 1-digit numbers are **not** right truncatable Harshad numbers.
For example `201` (which is a Harshad number) yields `20`, then `2` when right-truncated, which are all Harshad numbers. Thus `201` is a *right truncatable Harshad number*.
## Your task
Given a range of numbers (`(a, b)`, both included), return the list of right truncatable Harshad numbers in this range.
```if-not:javascript
Note: there are `500` random tests, with 0 <= `a` <= `b` <= 10^(16)
```
```if:javascript
Note: there are `500` random tests, with `0 <= a <= b <= Number.MAX_SAFE_INTEGER`
```
## Examples
```
0, 20        -->  [10, 12, 18, 20]
30, 100      -->  [30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100]
90, 200      -->  [90, 100, 102, 108, 120, 126, 180, 200]
200, 210     -->  [200, 201, 204, 207, 209, 210]
1000, 2000   -->  [1000, 1002, 1008, 1020, 1026, 1080, 1088, 1200, 1204, 1206, 1260, 1800, 2000]
2200, 2300   -->  []
9000002182976, 9000195371842  -->  [9000004000000, 9000004000008]
```
---
## My other katas
If you enjoyed this kata then please try [my other katas](https://www.codewars.com/collections/katas-created-by-anter69)! :-)
#### *Translations are welcome!*
import functools
import itertools


def rthn_between(a, b):
    k1 = len(str(b))+1
    k0 = len(str(a))-1
    harshads = set.union(*map(n_part_harshad, range(k0, k1)))
    return  sorted( [i for i in harshads if i in range(max(10,a),b+1) ] )

@functools.lru_cache(None)
def n_part_harshad(k):
    vals = set(range(10))
    if k < 1: return vals - {0}
    prevs = n_part_harshad(k-1)
    groups = (10*a+b for a,b in  itertools.product(prevs, vals) )
    return set(filter(part_harshad, groups))

def r_harshad(n):
    k = str(n)
    vals = (int(k[:i]) for i in range(1,len(k)+1) )
    return n>9 and  all( map(part_harshad, vals))

@functools.lru_cache(None)
def part_harshad(n):
    return n% dig_sum(n)==0
    
def dig_sum(n):
    return sum(map(int,str( n)))
import functools
import itertools


def rthn_between(a, b):
    k1 = len(str(b))+1
    k0 = len(str(a))-1
    harshads = set.union(*map(n_part_harshad, range(k0, k1)))
    return  sorted( [i for i in harshads if i in range(max(10,a),b+1) ] )

@functools.lru_cache(None)
def n_part_harshad(k):
    vals = set(range(10))
    if k < 1: return vals - {0}
    prevs = n_part_harshad(k-1)
    groups = (10*a+b for a,b in  itertools.product(prevs, vals) )
    return set(filter(part_harshad, groups))

def r_harshad(n):
    k = str(n)
    vals = (int(k[:i]) for i in range(1,len(k)+1) )
    return n>9 and  all( map(part_harshad, vals))

@functools.lru_cache(None)
def part_harshad(n):
    return n% dig_sum(n)==0
    
def dig_sum(n):
    return sum(map(int,str( n)))