login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343075
Digitally delicate square numbers (changing any one decimal digit always produces a nonsquare).
0
25, 121, 144, 169, 196, 256, 289, 324, 1024, 1089, 1156, 1296, 1369, 1444, 1521, 1681, 1764, 1849, 1936, 2500, 3136, 3249, 3364, 3481, 3721, 3844, 3969, 4096, 4356, 4489, 4624, 4761, 5041, 5184, 6084, 6241, 6561, 6724, 6889, 7056, 7396
OFFSET
1,1
COMMENTS
If k is the count of digitally delicate square numbers <= n, then empirically lim_{n->oo} k/n = sqrt(5)/3.
EXAMPLE
n = 25, changing the digit 2 in 25 to d5, d from {0,1,3,4,5,6,7,8,9} gives no square, changing the digit 5 in 25 to 2d, d from {0,1,2,3,4,6,7,8,9} gives no square. Thus n = 25 is a member of the sequence.
MATHEMATICA
changes[n_] := Module[{d = IntegerDigits[n]}, FromDigits @ ReplacePart[d, First[#] -> Last[#]] & /@ Tuples[{Range[Length[d]], Range[0, 9]}]]; q[n_] := AllTrue[changes[n], # == n || ! IntegerQ @ Sqrt[#] &]; Select[Range[100]^2, q] (* Amiram Eldar, Apr 04 2021 *)
PROG
(Python)
from sympy import integer_nthroot
def is_square(n): return integer_nthroot(n, 2)[1]
def change1(n):
s = str(n)
for i in range(len(s)):
for d in set("0123456789") - {s[i]}:
yield int(s[:i] + d + s[i+1:])
def ok(sqr): return not any(is_square(t) for t in change1(sqr))
print(list(filter(ok, (k*k for k in range(87))))) # Michael S. Branicky, Apr 04 2021
CROSSREFS
Sequence in context: A206472 A036057 A083509 * A339130 A256519 A298009
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Apr 04 2021
STATUS
approved