def fct(n):
    for k in range(n+1):
        double = 2 * k
        carre = k ** 2
        somme_d, somme_c = 0, 0
        while double > 0:
            somme_d += double % 10
            double = double // 10

        while carre > 0:
            somme_c += carre % 10
            carre = carre // 10

        if somme_c == somme_d:
            print(k, end = ' ')
