cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A343075 Digitally delicate square numbers (changing any one decimal digit always produces a nonsquare).

This page as a plain text file.
%I A343075 #25 Apr 05 2021 04:01:54
%S A343075 25,121,144,169,196,256,289,324,1024,1089,1156,1296,1369,1444,1521,
%T A343075 1681,1764,1849,1936,2500,3136,3249,3364,3481,3721,3844,3969,4096,
%U A343075 4356,4489,4624,4761,5041,5184,6084,6241,6561,6724,6889,7056,7396
%N A343075 Digitally delicate square numbers (changing any one decimal digit always produces a nonsquare).
%C A343075 If k is the count of digitally delicate square numbers <= n, then empirically lim_{n->oo} k/n = sqrt(5)/3.
%e A343075 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.
%t A343075 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 *)
%o A343075 (Python)
%o A343075 from sympy import integer_nthroot
%o A343075 def is_square(n): return integer_nthroot(n, 2)[1]
%o A343075 def change1(n):
%o A343075   s = str(n)
%o A343075   for i in range(len(s)):
%o A343075     for d in set("0123456789") - {s[i]}:
%o A343075       yield int(s[:i] + d + s[i+1:])
%o A343075 def ok(sqr): return not any(is_square(t) for t in change1(sqr))
%o A343075 print(list(filter(ok, (k*k for k in range(87))))) # _Michael S. Branicky_, Apr 04 2021
%Y A343075 Cf. A000290, A050249.
%K A343075 nonn,base
%O A343075 1,1
%A A343075 _Ctibor O. Zizka_, Apr 04 2021