A387070 Remove every digit that appears in n from the decimal representation of n^2. If no digits remain, set a(n) = 0.
0, 0, 4, 9, 16, 2, 3, 49, 64, 81, 0, 2, 44, 69, 96, 22, 25, 289, 324, 36, 4, 44, 484, 59, 576, 6, 7, 9, 74, 841, 9, 96, 104, 1089, 1156, 122, 129, 169, 1444, 1521, 16, 68, 176, 189, 1936, 202, 211, 2209, 230, 201, 2, 260, 704, 2809, 2916, 302, 313, 3249, 3364, 3481, 3, 372, 3844, 99, 9, 422, 435
Offset: 0
Examples
a(25) = 6 since 25^2 = 625 and once we remove the 2 and 5, we are left with 6. a(26) = 7 since 26^2 = 676 and once we remove the 6, we are left with 7.
Programs
-
Mathematica
a[n_] := FromDigits[Select[IntegerDigits[n^2], FreeQ[IntegerDigits[n], #] &]]; Array[a, 100, 0] (* Amiram Eldar, Aug 16 2025 *)
-
PARI
a(n)={my(S=Set(digits(n))); fromdigits(select(x->!setsearch(S,x), digits(n^2)))} \\ Andrew Howroyd, Aug 15 2025
-
Python
def A387070(k): s = set(str(k)) t = "".join(d for d in str(k**2) if d not in s) return int(t) if t != "" else 0 print([A387070(n) for n in range(67)]) # Michael S. Branicky, Aug 16 2025