# Definition

**_Disarium number_** is the number that *The sum of its digits powered with their respective positions is equal to the number itself*.

____

# Task

**_Given_** a number, **_Find if it is Disarium or not_** . 
____

# Warm-up (Highly recommended)

# [Playing With Numbers Series](https://www.codewars.com/collections/playing-with-numbers)
___

# Notes 

* **_Number_** *passed is always*  **_Positive_** .
* **_Return_** *the result as* **_String_**
___

# Input >> Output Examples

```
disariumNumber(89) ==> return "Disarium !!"
```
## **_Explanation_**:

* Since , **_8^(1) + 9^(2) = 89_** , thus *output* is `"Disarium !!"`
___

```
disariumNumber(564) ==> return "Not !!"
```
## **_Explanation_**:

Since , **_5^(1) + 6^(2) + 4^(3) = 105 != 564_** ,  thus *output* is `"Not !!"`

___
___
___

# [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)

# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)

# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)
___

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

Difficulty: EASY
Starter code: def disarium_number(number):
	

Solutions:
def disarium_number(n):
	return 'Disarium !!' if n == sum((int(d) ** i for (i, d) in enumerate(str(n), 1))) else 'Not !!'


def disarium_number(number):
	a = 0
	for (j, i) in enumerate(str(number)):
		a += int(i) ** (j + 1)
	return 'Disarium !!' if a == number else 'Not !!'


def disarium_number(num):
	total = sum((int(n) ** i for (i, n) in enumerate(str(num), 1)))
	return '{} !!'.format('Disarium' if total == num else 'Not')


from itertools import count

def disarium_number(number):
	return ('Not !!', 'Disarium !!')[number == sum(map(pow, map(int, str(number)), count(1)))]


def disarium_number(number):
	return ['Not !!', 'Disarium !!'][number in [89, 135, 175, 518, 598, 1306, 1676, 2427, 2646798] or len(str(number)) == 1]


def disarium_number(number):
	return 'Disarium !!' if sum((int(digit) ** i for (i, digit) in enumerate(str(number), start=1))) == number else 'Not !!'


def disarium_number(number):
	disarium = number == sum([int(d) ** (i + 1) for (i, d) in enumerate(str(number))])
	return 'Disarium !!' if disarium else 'Not !!'


def disarium_number(number):
	return 'Disarium !!' if sum((int(v) ** (k + 1) for (k, v) in enumerate(str(number)))) == number else 'Not !!'


def disarium_number(number):
	return 'Disarium !!' if sum((int(c) ** i for (i, c) in enumerate(str(number), 1))) == number else 'Not !!'


def disarium_number(number):
	sum_d = 0
	for (index, d) in enumerate(str(number), start=1):
		sum_d += int(d) ** index
	return 'Disarium !!' if sum_d == number else 'Not !!'


def disarium_number(number):
	return 'Disarium !!' if sum([int(m) ** (n + 1) for (n, m) in enumerate(str(number))]) == number else 'Not !!'


def disarium_number(n):
	return ('Not !!', 'Disarium !!')[sum((int(j) ** i for (i, j) in list(enumerate(str(n), 1)))) == n]


def disarium_number(number):
	disarium_sum = sum((int(digit) ** pos for (pos, digit) in enumerate(str(number), 1)))
	if disarium_sum == number:
		return 'Disarium !!'
	return 'Not !!'


def disarium_number(number):
	m = 10
	i = 10
	result = 0
	count = 1
	once = True
	a = None
	zero_count = 0
	while count > 0:
		if int(number / i) != 0:
			if number % i == 0:
				a = int(number / i)
				zero_count += 1
			i *= 10
			count += 1
		else:
			if a is not None:
				number = a
				count = count - zero_count
				i = 10 ** count
			j = count
			for q in range(j + 1):
				k = number * m ** count / i
				p = int(k / 10 % 1 * 10)
				if once and number % 2 != p % 2:
					p += 1
					once = False
				once = False
				result += p ** count
				count -= 1
				if count < 1:
					break
	if number == result:
		return 'Disarium !!'
	return 'Not !!'


from itertools import starmap

def disarium_number(number):
	return ('Not !!', 'Disarium !!')[number == sum(starmap(pow, [(x, i + 1) for (i, x) in enumerate(map(int, str(number)))]))]


def disarium_number(n):
	return ['Not !!', 'Disarium !!'][sum((int(y) ** x for (x, y) in enumerate(str(n), 1))) == n]


def disarium_number(number):
	b = sum([pow(int(x), i + 1) for (i, x) in enumerate(str(number))])
	return 'Disarium !!' if b == number else 'Not !!'


def disarium_number(number):
	return 'Disarium !!' if sum((int(j) ** (i + 1) for (i, j) in enumerate(list(str(number))))) == number else 'Not !!'


disarium_number = lambda n: ['Not !!', 'Disarium !!'][n == sum((int(b) ** a for (a, b) in enumerate(str(n), 1)))]


def disarium_number(number):
	total = 0
	res = list(str(number))
	count = 0
	for item in res:
		total += int(item) ** (count + 1)
		count += 1
	if total == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(number):
	rs = sum([n ** (i + 1) for (i, n) in enumerate(map(int, str(number)))])
	return 'Disarium !!' if rs == number else 'Not !!'


def disarium_number(n):
	x = [int(x) for x in str(n)]
	s = 0
	for i in range(len(str(n))):
		s = s + x[i] ** (i + 1)
	return 'Disarium !!' if s == n else 'Not !!'


disarium_number = lambda n: ['Not !!', 'Disarium !!'][sum((int(str(n)[i]) ** (i + 1) for i in range(len(str(n))))) == n]


def disarium_number(number):
	numArr = str(number)
	mySum = 0
	i = 1
	for num in numArr:
		mySum += int(num) ** i
		i = i + 1
	if mySum == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(number):
	str_number = str(number)
	result = 0
	for (i, num) in enumerate(str_number):
		result += int(num) ** (i + 1)
	return 'Disarium !!' if result == number else 'Not !!'


disarium_number = lambda n: ['Not !!', 'Disarium !!'][sum((int(d) ** (i + 1) for (i, d) in enumerate(str(n)))) == n]


from math import pow

def disarium_number(number):
	return 'Disarium !!' if sum((pow(int(y), x + 1) for (x, y) in enumerate(str(number)))) == number else 'Not !!'


def disarium_number(number):
	x = []
	z = 0
	y = 1
	for i in str(number):
		x.append(int(i))
	for i in x:
		z += i ** y
		y += 1
	if number == z:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(number):
	b = []
	a = list(str(number))
	a = [int(x) for x in a]
	for i in range(len(a)):
		print(a[i], i + 1)
		b.append(a[i] ** (i + 1))
	if sum(b) == number:
		return 'Disarium !!'
	return 'Not !!'


def disarium_number(number):
	res = []
	for (index, value) in enumerate(str(number)):
		res.append(int(value) ** (index + 1))
	return 'Disarium !!' if sum(res) == number else 'Not !!'


def disarium_number(number):
	result = 0
	numLst = [int(x) for x in str(number)]
	for i in range(len(numLst)):
		result += pow(numLst[i], i + 1)
	return 'Disarium !!' if result == number else 'Not !!'


def disarium_number(number):
	nms = [int(x) for x in str(number)]
	o = 0
	for (n, i) in enumerate(nms):
		o += i ** (n + 1)
	if o == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(x):
	return 'Disarium !!' if [sum((int(e) ** (i + 1) for (i, e) in enumerate(str(x))))] == [x] else 'Not !!'


def disarium_number(number):
	big_number = 0
	i = 1
	for dig in str(number):
		big_number += pow(int(dig), i)
		i += 1
	if big_number == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(n):
	return 'Disarium !!' if sum([int(str(n)[x]) ** (x + 1) for x in range(len(str(n)))]) == n else 'Not !!'


def disarium_number(number):
	res = 0
	for i in range(len(str(number))):
		res += int(str(number)[i]) ** (i + 1)
	if number == res:
		return 'Disarium !!'
	return 'Not !!'


def disarium_number(number):
	Digits = list(map(int, list(str(number))))
	SumDigitsPow = 0
	for i in range(len(Digits)):
		SumDigitsPow += pow(Digits[i], i + 1)
	if SumDigitsPow == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(number):
	num_list = list(str(number))
	return 'Disarium !!' if sum((int(num_list[i]) ** (i + 1) for i in range(len(num_list)))) == number else 'Not !!'


from functools import reduce

def disarium_number(number):
	return 'Disarium !!' if sum((int(x) ** i for (i, x) in enumerate(list(str(number)), 1))) == number else 'Not !!'


def disarium_number(num):
	return 'Disarium !!' if sum((int(i) ** idx for (idx, i) in enumerate(str(num), 1))) == num else 'Not !!'


def disarium_number(number):
	newNumber = 0
	for (index, value) in enumerate(str(number)):
		newNumber += int(value) ** (int(index) + 1)
	if newNumber == number:
		return 'Disarium !!'
	return 'Not !!'


def disarium_number(n):
	return ['Not !!', 'Disarium !!'][sum((int(k) ** i for (i, k) in enumerate(str(n), 1))) == n]


def disarium_number(number):
	return ('Not', 'Disarium')[number == sum((int(d) ** i for (i, d) in enumerate(str(number), 1)))] + ' !!'


def disarium_number(number):
	return 'Disarium !!' if sum([int(x) ** (y + 1) for (y, x) in enumerate(str(number))]) == number else 'Not !!'


def disarium_number(number):
	n_1 = [int(i) for i in str(number)]
	n = [int(i) for i in range(1, len(n_1) + 1)]
	strong = sum([n_1[i] ** n[i] for i in range(len(n_1))])
	if strong == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(n):
	dissed = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 89, 135, 175, 518, 598, 1306, 1676, 2427, 2646798]
	return 'Disarium !!' if n in dissed else 'Not !!'


def disarium_number(number):
	n = list(map(int, str(number)))
	sc = []
	for (i, s) in enumerate(n, 1):
		sc.append(s ** i)
	if sum(sc) == number:
		return 'Disarium !!'
	return 'Not !!'


def disarium_number(number):
	digits = list(str(number))
	a = 0
	for (index, digit) in enumerate(digits):
		a += int(digit) ** (index + 1)
	return 'Disarium !!' if a == number else 'Not !!'


def disarium_number(number):
	a = 1
	s = 0
	for i in str(number):
		s += int(i) ** a
		a += 1
	return 'Disarium !!' if s == number else 'Not !!'


def disarium_number(number):
	sum1 = []
	for (i, v) in enumerate(str(number), 1):
		sum1.append(pow(int(v), i))
	return 'Disarium !!' if sum(sum1) == number else 'Not !!'


def disarium_number(number):
	a = [i for i in range(1, len(str(number)) + 1)]
	b = [int(i) for i in list(str(number))]
	c = [x ** y for (x, y) in zip(b, a)]
	return 'Disarium !!' if sum(c) == number else 'Not !!'


def disarium_number(number: int) -> str:
	powers = sum((pow(int(n), i) for (i, n) in enumerate(str(number), 1)))
	return 'Disarium !!' if powers == number else 'Not !!'


def disarium_number(number):
	tmp = number
	arr = []
	while tmp > 0:
		arr.append(tmp % 10)
		tmp //= 10
	total = 0
	l = len(arr)
	for i in range(l):
		total += arr[i] ** (l - i)
	if total == number:
		return 'Disarium !!'
	return 'Not !!'


def disarium_number(number):
	print(number)
	return 'Disarium !!' if sum((int(d) ** (i + 1) for (i, d) in enumerate(f'{number}'))) == number else 'Not !!'


def disarium_number(number):
	digits = []
	numberc = number
	while number > 0:
		digit = number % 10
		digits.append(digit)
		number = number // 10
	digit = []
	while len(digits) > 0:
		digit.append(digits.pop())
	tot = 0
	i = 0
	while i < len(digit):
		term = digit[i] ** (i + 1)
		tot = tot + term
		i = i + 1
	if tot == numberc:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(number):
	n = []
	a = 0
	for i in str(number):
		n.append(int(i))
	for i in range(len(n)):
		a += int(n[i]) ** int(i + 1)
	return 'Disarium !!' if a == number else 'Not !!'


def disarium_number(number):
	power = 0
	res = 0
	numbers = [int(i) for i in str(number)]
	for (i, v) in enumerate(numbers):
		power = v ** (i + 1)
		res += power
	return 'Disarium !!' if res == number else 'Not !!'


def disarium_number(num):
	it = list(str(num))
	count = 1
	true = 0
	for i in it:
		true += int(i) ** count
		count += 1
	if true == num:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(n):
	s = str(n)
	return 'Disarium !!' if sum([int(y) ** (x + 1) for (x, y) in list(enumerate(s))]) == n else 'Not !!'


def disarium_number(number):
	e = 0
	s = 0
	for x in str(number):
		e += 1
		s += int(x) ** e
	return 'Disarium !!' if s == number else 'Not !!'


def disarium_number(number):
	result = [int(i) for i in str(number)]
	arr = []
	for (j, i) in enumerate(result, start=1):
		m = [j, i]
		x = i ** j
		arr.append(x)
		s = sum(arr)
	if s == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


true = 'Disarium !!'
false = 'Not !!'
is_dis = lambda n: sum([int(d) ** i for (i, d) in enumerate(str(n), start=1)]) == n

def disarium_number(n):
	return (false, true)[is_dis(n)]


def disarium_number(number):
	digits = [int(d) for d in str(number)]
	dis_calc = 0
	for (i, d) in enumerate(digits):
		dis_calc += d ** (i + 1)
	return 'Disarium !!' if dis_calc == number else 'Not !!'


def disarium_number(n):
	return 'Disarium !!' if sum([x[1] ** x[0] for x in list(enumerate(list(map(int, list(str(n)))), 1))]) == n else 'Not !!'


def disarium_number(number):
	number_word = str(number)
	count = 1
	cur_sum = 0
	for i in str(number):
		cur_sum = cur_sum + int(i) ** count
		count += 1
	if cur_sum == number:
		return 'Disarium !!'
	else:
		return 'Not !!'


def disarium_number(number):
	digits = [int(n) for n in str(number)]
	new_number = sum((n ** (i + 1) for (i, n) in enumerate(digits)))
	return 'Disarium !!' if new_number == number else 'Not !!'


def disarium_number(number):
	return 'Disarium !!' if number == sum((int(digit) ** position for (position, digit) in enumerate(str(number), 1))) else 'Not !!'