OFFSET
1,3
MATHEMATICA
Select[Range[0, 10^5], StringContainsQ[IntegerString[#^2, 3], IntegerString[#, 3]] &] (* Paolo Xausa, Apr 05 2024 *)
PROG
(Python)
from sympy.ntheory import digits
def s(n, base=3): return "".join(map(str, digits(n, base)[1:]))
def ok(n): return s(n) in s(n**2)
print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Apr 04 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved