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).

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Apr 04 2021

Keywords

Comments

If k is the count of digitally delicate square numbers <= n, then empirically lim_{n->oo} k/n = sqrt(5)/3.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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