Problem:
Dudeney Number A Dudeney number is a positive integer for which the sum of its decimal digits is equal to the cube root of the number. For example, $512$ is a Dudeney number because it is the cube of $8$, which is the sum of its decimal digits ($5 + 1 + 2$). In this problem, we think of a type similar to Dudeney numbers and try to enumerate them. Given a non-negative integer $a$, an integer $n$ greater than or equal to 2 and an upper limit $m$, make a program to enumerate all $x$’s such that the sum of its decimal digits $y$ satisfies the relation $x = (y + a)^n$, and $x \leq m$. Input The input is given in the following format. $a$ $n$ $m$ The input line provides three integers: $a$ ($0 \leq a \leq 50$), $n$ ($2 \leq n \leq 10$) and the upper limit $m$ ($1000 \leq m \leq 10^8$). Output Output the number of integers that meet the above criteria. Sample Input 1 16 2 1000 Sample Output 1  2  Two:  $400 = (4 + 0 + 0 + 16)^2$ and $841 = (8 + 4 + 1 + 16)^2$  Sample Input 2  0 3 5000  Sample Output 2  3  Three: $1=1^3$, $512 = (5 + 1 + 2)^3$ and $4913 = (4 + 9 + 1 + 3)^3$.  Sample Input 3  2 3 100000  Sample Output 3  0  There is no such number $x$ in the range below $100,000$ such that its sum of decimal digits $y$ satisfies the relation $(y+2)^3 = x$.

Solution (Python):
a,n,m=list(map(int,input().split()))
count=0
check_list=[]
i=0
if a==0:i=1
while (i+a)**n<m:
    check_list.append((i+a)**n)
    i+=1
for x in check_list:
    xl=[int(i) for i in list(str(x))]
    y=sum(xl)
    if x==(y+a)**n:count+=1
print(count)

Solution (Python):
list = []
a,n,s = map(int, input().split())
ans = []
for i in range(1,10001):
    if i**n <= s:
        list.append(i**n)
for i in list:
    k = str(i)
    d = a
    for j in k:
        d += int(j)
    if d**n == i:
        ans.append(i)
print(len(ans))

Solution (Python):

def f(x):
    ret = 0
    while(x > 0):
        ret = ret + x % 10
        x = x // 10
    return ret

a,n,m = [int(i) for i in input().split()]

ans = 0
i = 1
ii = 1
while(ii <= m):
    if ii == (f(ii)+a)**n:
        ans += 1
    i += 1
    ii = i**n


print(ans)

Solution (Python):

def solve():
    a, n, m = map(int, input().split())

    max_y = len(str(m)) * 9
    count = 0
    for y in range(1, max_y + 1):
        x = (y + a) ** n
        if x <= m and y == sum([int(i) for i in str(x)]):
            
            count += 1
    print(count)


if __name__ == '__main__':
    solve()

Solution (Python):
a, n, m = map(int, input().split())
ans = 0
for y in range(1, 50):
    x = (y + a)**n
    if 1 <= x <= m and y == sum(map(int, str(x))):
        ans += 1
print(ans)

Solution (Python):
a, n, m = map(int, input().split())
candi = []
ans = 0

for i in range(a + 1, 9*8+a+1):
    if i**n <= m:
        candi.append(i**n)
for j in candi:
    k = j
    digit = []
    for _ in range(9):
        digit.append(k%10)
        k //= 10
    if (sum(digit)+a)**n == j:
        ans += 1
print(ans)

Solution (Python):
def digit_sum(x):
    net = 0
    for f in str(x):
        net += int(f)
    return net

def main():
    a, n, m = map(int, input().split())
    cnt = 0
    x = 0

    while True:
        y = (x + a) ** n
        if y > m:
            break
        
        if y > 0 and digit_sum(y) == x:
            cnt += 1
        
        x += 1

    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
def val(x):
    sum = 0
    while x > 0:
        sum += x%10
        x //= 10
    return sum

a,n,m = map(int, input().split())
cnt = 0

for y in range(1, 73):
    x = 1
    for t in range(1, n+1):
      x *= (y+a)
    if x <= m and val(x) == y:
        cnt += 1

print(cnt)

Solution (Python):
a, n, m = map(int, input().split())
ans = 0
for i in range(a, int(m ** (1 / 2)) + 1):
  x = i ** n
  if not 1 <= x <= m:
    continue
  y = i - a
  if sum(map(int, list(str(x)))) == y:
    ans += 1
print(ans)

Solution (Python):
def digit_sum(x):
    ret = 0
    for c in str(x):
        ret += int(c)
    return ret

def main():
    a,n,m = map(int,input().split())

    ans = 0
    y = 0
    while True:
        x = (y+a)**n
        if x > m:
            break

        if x>0 and digit_sum(x) == y:
            ans += 1

        y += 1

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
list = []
a,n,s = map(int, input().split())
ans = []
for i in range(1,10001):
    if i**n <= s:
        list.append(i**n)
for i in list:
    k = str(i)
    d = a
    for j in k:
        d += int(j)
    if d**n == i:
        ans.append(i)
print(len(ans))