def fct(n):
    L = [] # liste vide
    for k in range(n+1):
        s = 0
        x = k**2
        while x > 0:
            u = x % 10
            s = s + u
            x = x // 10

        if s == k: L.append(k)
    return L
