Most of this problem is by the original author of [the harder kata](https://www.codewars.com/kata/556206664efbe6376700005c), I just made it simpler.

I read a book recently, titled "Things to Make and Do in the Fourth Dimension" by comedian and mathematician Matt Parker ( [Youtube](https://www.youtube.com/user/standupmaths) ), and in the first chapter of the book Matt talks about problems he likes to solve in his head to take his mind off the fact that he is in his dentist's chair, we've all been there!

The problem he talks about relates to polydivisible numbers, and I thought a kata should be written on the subject as it's quite interesting. (Well it's interesting to me, so there!)

### Polydivisib... huh what?

So what are they?

A polydivisible number is divisible in an unusual way. The first digit is cleanly divisible by `1`, the first two digits are cleanly divisible by `2`, the first three by `3`, and so on.

### Examples

Let's take the number `1232` as an example.
```
1     / 1 = 1     // Works
12    / 2 = 6     // Works
123   / 3 = 41    // Works
1232  / 4 = 308   // Works
```
`1232` is a polydivisible number.


However, let's take the number `123220` and see what happens.
```
 1      /1 = 1    // Works
 12     /2 = 6    // Works
 123    /3 = 41   // Works
 1232   /4 = 308  // Works
 12322  /5 = 2464.4         // Doesn't work
 123220 /6 = 220536.333...  // Doesn't work
```
`123220` is not polydivisible.

### Your job: check if a number is polydivisible or not.

Return `true` if it is, and `false` if it isn't.

Note: All inputs will be valid numbers between `0` and `2^53-1 (9,007,199,254,740,991)` (inclusive).   
Note: All single digit numbers (including `0`) are trivially polydivisible.
Note: Except for `0`, no numbers will start with `0`.

Difficulty: introductory

Starter code:

def polydivisible(x):
	

Solutions:
def polydivisible(x):
    for i in range(1, len(str(x)) + 1):
        if int(str(x)[:i]) % i != 0:
            return False
    return True

def polydivisible(x):
    s = str(x)
    return all(int(s[:i]) % i == 0 for i in range(1, len(s) + 1))

def polydivisible(x):
    return all(int(str(x)[:i+1])%(i+1)==0 for i in range(len(str(x))))

def polydivisible(x):
    l = len(str(x))
    return all(x // (10**i) % (l-i) == 0 for i in range(l))

def polydivisible(x):
    if x < 10: return True
    return not (x % len(str(x))) and polydivisible(int(str(x)[:-1]))

from itertools import accumulate

def polydivisible(x):
    return all(
        int(''.join(s)) % i == 0
        for i, s in enumerate(accumulate(str(x)), 1)
    )

def polydivisible(n):
    s = str(n)
    return all(not int(s[:i])%i for i in range(2,len(s)+1))

def polydivisible(x):
    x = str(x)
    return all(0 for i in range(1, len(x) + 1) if int(x[:i]) % i)

def polydivisible(x):
    x = str(x)
    return len([0 for i in range(1, len(x) + 1) if int(x[:i]) % i]) == 0

def polydivisible(x):
    li = list(str(x))
    for i, digit in enumerate(li):
        if int("".join(li[:i+1])) % (i + 1) != 0:
            return False
    return True