[Question]
  [
Most square numbers have at least 1 different square number with which their [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) is exactly 1. For a given square \$x\$, each square that meets this condition is called a *Levenshtein neighbour* of \$x\$. For example, \$36\$ is a Levenshtein neighbour of \$16\$, as only 1 edit (\$1 \to 3\$) is required. However, \$64\$ is not a Levenshtein neighbour of \$16\$, as it requires a minimum of 2 edits. Numbers that have leading 0s (\$2025 \to 025\$) are *not* Levenshtein neighbours.
Your task is to take a square number as input and to output, in any reasonable format, the complete list of it's Levenshtein neighbours. You may include repeat neighbours in the list, if you wish, but you may not include the original input, as it isn't a Levenshtein neighbour of itself.
Any reasonable format should include some sort of separator between the outputs, such as `,` or a newline, and can output characters with the corresponding Unicode value (i.e. brainfuck) rather than the numbers themselves. The order of the output doesn't matter.
This input will always be a square number, greater than \$0\$. Your program should have no *theoretical* limit, but if it fails for large numbers for practical reasons (e.g. beyond 32-bit numbers), that's completely fine.
If the input does not have any Levenshtein neighbours, the output must clearly reflect this, such as outputting nothing, an empty array/string, a negative integer, \$0\$, etc.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins.
## Test cases
These are the results for the squares of \$1\$ through to \$20\$:
```
  1: 4, 9, 16, 81
  4: 1, 9, 49, 64
  9: 1, 4, 49
 16: 1, 36, 169, 196
 25: 225, 256, 625
 36: 16, 361
 49: 4, 9
 64: 4
 81: 1, 841
100: 400, 900, 1600, 8100
121: 1521
144: 1444
169: 16, 1369
196: 16, 1296, 1936
225: 25, 625, 1225, 2025, 4225, 7225
256: 25
289: 2809
324: 3249
361: 36, 961
400: 100, 900, 4900, 6400
```
In addition, `1024` does not have any neighbours, so is a good test case.
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~11 10~~ 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
-4 thanks to Grimy !! (square first rather than looking for squares saves 3; use 10^n saves 1)
```
°Lnʒ.L
```
Takes an integer, outputs a, possibly empty, list
**[Try it online!](https://tio.run/##yy9OTMpM/f//0AafvFOT9Hz@/zcBAA "05AB1E – Try It Online")** - This is crazy-slow due to the `°`, so no point trying it even for `9`.  
Or **[Try a slightly faster version](https://tio.run/##yy9OTMpM/f/fQtsn79QkPZ///40MjEwB "05AB1E – Try It Online")** - This one adds eight instead with `8+` then uses the same approach.
### How?
```
°Lnʒ.L - f(integer)    stack = n
°      - push 10^n             10^n
 L     - range                 [1,2,3,...,10^n]
  n    - square                [1,4,9,...,10^2n]
   ʒ   - filter keep if == 1:
    .L -   Levenshtein distance
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~142~~ 138 bytes
```
.?
$'¶$`#$&$'¶$`#$'¶$`$&
#
0$%'¶$%`1$%'¶$%`2$%'¶$%`3$%'¶$%`4$%'¶$%`5$%'¶$%`6$%'¶$%`7$%'¶$%`8$%'¶$%`9
A`^0
Dr`
\d+
$*
-2G`(\b1|11\1)+\b
%`1
```
[Try it online!](https://tio.run/##K0otycxL/P9fz55LRf3QNpUEZRU1GANMqahxKXMZqKiCOKoJhjCGEYxhDGOYwBimMIYZjGEOY1jAGJZcjglxBlwuRQlcMSnaXCpaXLpG7gkaMUmGNYaGMYaa2jFJXEDb/v83MjAyBQA "Retina 0.8.2 – Try It Online") Explanation:
```
.?
$'¶$`#$&$'¶$`#$'¶$`$&
```
For each digit, try a) removing it b) preceding it with a different
digit c) changing it to a different digit. For now, the different digit is marked with a `#`.
```
#
0$%'¶$%`1$%'¶$%`2$%'¶$%`3$%'¶$%`4$%'¶$%`5$%'¶$%`6$%'¶$%`7$%'¶$%`8$%'¶$%`9
```
For each potential different digit, substitute each possible digit.
```
A`^0
```
Remove numbers that now begin with zero.
```
Dr`
```
Remove all duplicated numbers. (This just leaves the lines blank.)
```
\d+
$*
```
Convert to unary.
```
-2G`(\b1|11\1)+\b
```
Keep all square numbers except the last (which is always the input number).
```
%`1
```
Convert the remaining numbers back to decimal.
[Answer]
# [R](https://www.r-project.org/), ~~42~~ 41 bytes
-1 byte with the bound \$(9n)^2\$.
```
function(n,y=(1:(9*n))^2)y[adist(n,y)==1]
```
[Try it online!](https://tio.run/##K/qfZvs/rTQvuSQzP08jT6fSVsPQSsNSK09TM85IszI6MSWzuAQkrmlraxj7P03DUJMrTcPEEkQaGhiZgGgjUzPN/wA "R – Try It Online")
All Levenshtein neighbours of \$n\$ are smaller than \$91n\$ (That bound is attained, for example, by \$1\to 91\$ or \$100\to9100\$). Here, I am using instead the bound \$(9n)^2=81n^2\$. For \$n>1\$, \$81n^2>91n\$ so we are fine. For \$n=1\$, this bound misses one Levenshtein neighbour: \$1\to91\$; since \$91\$ is not a square, we are fine.
Lists all square numbers between \$1\$ and \$(9n)^2\$, and keeps those with Levenshtein distance equal to 1.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~173~~ ~~167~~ ~~149~~ ~~148~~ ~~147~~ ~~144~~ ~~139~~ 138 bytes
```
lambda n,I=int:{(I(I(v)**.5)**2==I(v))*I(v)for v in[`n`[:i]+`j-1`[:j]+`n`[i+k:]or 0for j in range(11)for i in range(n)for k in 0,1]}-{0,n}
```
[Try it online!](https://tio.run/##XY5RCoNADES/6yny6epaXFspLOwBPINd0NLaRm0UEaGIZ99m/SmUwGQyvMCMn/k1UOYac3V9/b7dayBZGKRZr2HBs4goOuYsmTH@EpHXZphgAaSyoqrUaOOqTRS7lh0nGHfaMpJ6rmUOppqej1Cp/RN/Ce1B54NUKrslayppc3@UkqeLiMtzbnVwGCduBygBuZSEJvRbBO4L "Python 2 – Try It Online")
19+3+5+1=28! bytes thx to [Jonathan Allan](https://codegolf.stackexchange.com/users/53748/jonathan-allan).
[Answer]
# Oracle SQL, 93 bytes
```
select level*level from t where utl_match.edit_distance(x,level*level)=1connect by level<10*x
```
Test in SQL\*PLus.
```
SQL> set heading off
SQL> with t(x) as (select 225 from dual)
  2  select level*level from t where utl_match.edit_distance(x,level*level)=1connect by level<10*x
  3  /
         25
        625
       1225
       2025
       4225
       7225
6 rows selected.
```
[Answer]
# [PHP](https://php.net/), 62 bytes
```
for(;$argn*92>$n=++$i**2;levenshtein($argn,$n)==1&&print$n._);
```
[Try it online!](https://tio.run/##VVLbToQwEH3nK5pNswEWXVpKpSL65gf4qsZsDArJpksW1hfjr4udC6uS0HbmzMw5pzB0w3xzN3RDFMmpHadRNOIxEvioTGy3wmTCZULZTFSKAYOAQsCE1xoG3AIYACgJnZQsLMyBYc4SpkvENOy6DLDVJSEFd1loY17jzoIoYUkIs1dqIaoMdag8pwLYHSzKwloFgAo095SaOwx7M4amol4WogpLxEH/b1JDoFxBlvRiqUQzgKO5HFaD5yvNJtEx1lJYEZWucqIpNIkJOycsyYXLcXwrhj2qs0eDqzWLxzyMIQIQET3XUfR2OLa71y7mT74bBZ6ST6wbjr2fxOqhHU/7gIZigq/FqsYCuTu@@/CjYLaeQ0FcYy51@lb6ZrORfZrqet9@tH7sprb3MeKZ9EnTqPUaKaS/fEnq@Q/lk2eGkx/bKZZ98i/0Ifyawcb3YZj6gx/ni/sf "PHP – Try It Online")
This script prints Levenshtein neighbors of input separated by `_` with a trailing separator, and if no neighbors are found, prints nothing.
Happily PHP has a built-in for [Levenshtein distance](https://www.php.net/manual/en/function.levenshtein.php)! This script loops over all square numbers from 1 to `input * 91`, since all valid Levenshtein neighbors (distance of 1) are in that range. Then prints every number in that range which has a Levenshtein distance of 1 with the input.
[Answer]
# [JavaScript (V8)](https://v8.dev/), ~~129 125~~ 123 bytes
Takes input as a string. Prints the Levenshtein neighbours to STDOUT.
```
s=>{for(t=9+s;t;t--)(t+='')**.5%1||(g=m=>m*n?1+g(m,--n)*(g(--m)-(s[m]==t[n++]))*g(m):m+n)(s.length,n=t.length)-1||print(t)}
```
[Try it online!](https://tio.run/##Xc/BboMwDAbge58il4mYOIjQgGDI7LTrXgBxQFWhnUioSNRL22dnnrTTTrb8f7bk7/E@htN2vUV9r/eJ9kDdY1o3GalRoY1t1BpkVJQkkKZZ@WaeTzmTo86l/sOoWTrU2kMqZ6m1Ay1D7wai2HulBoCUAbw75UGGbDn7OV7QU/xrQfO523b1UUZ47W1v0GKDpsKixGOFtsHKYm3Q5Dmagqu1nLJomLApSq51g8fCsuftX5cXdjhk/MTneLpIL6gTj4MQp9WHdTlnyzrL5EuQSIQSHlqOJlZK8IvtP8eDF@w/ "JavaScript (V8) – Try It Online")
### Commented
```
s => {                        // s = input
  for(                        // loop:
    t = 9 + s;                //   start with t = '9' + s
    t;                        //   repeat while t > 0
    t--                       //   decrement t after each iteration
  )                           //
    (t += '')                 //   coerce t to a string
    ** .5 % 1 ||              //   abort if t is not a square
    ( g =                     //   g is a recursive function to test whether the
                              //   Levenshtein distance between s and t is exactly 1
      m =>                    //   m = pointer into s (explicit parameter)
                              //   n = pointer into t (defined in the global scope)
        m * n ?               //     if both m and n are greater than 0:
          1 +                 //       add 1 to the final result and add the product of:
          g(m, --n) * (       //         - a recursive call with m and n - 1
            g(--m) -          //         - a recursive call with m - 1 and n - 1
            (s[m] == t[n++])  //           minus 1 if s[m - 1] = t[n - 1]
          ) *                 //
          g(m)                //         - a recursive call with m - 1 and n
        :                     //       else:
          m + n               //         stop recursion and return m + n
    )(s.length, n = t.length) //   initial call to g with m = s.length, n = t.length
    - 1 ||                    //   abort if the final result is not 1
    print(t)                  //   otherwise, print t
}                             //
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~53~~ 38 bytes
```
D;Ɱ⁵ṭJœP,œṖjþ⁵Ẏṭ@ḢF${ʋʋ€$ƲẎ%⁵1ị$ƇḌÆ²Ƈḟ
```
[Try it online!](https://tio.run/##y0rNyan8/9/F@tHGdY8atz7cudbr6OQAnaOTH@6clnV4H0hoVx9Q1OHhjkVuKtWnuk91P2pao3JsE1BYFShr@HB3t8qx9oc7eg63HdoEYsz/b/2oYY6Crp3Co4a51ofbj056uHOGCpeJQdChTYfbgZoj/wMA "Jelly – Try It Online")
There’s no built-in for Levenshtein distance so generates all possible 1-distance edits and then excludes those with leading zero and keeps only perfect squares. Doesn’t filter duplicates (as permitted). 
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~62~~ 59 bytes
```
f@n_:=Select[Range[9n]^2,EditDistance@@ToString/@{n,#}==1&]
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78/z/NIS/eyjY4NSc1uSQ6KDEvPTXaMi82zkjHNSWzxCWzuCQxLznVwSEkP7ikKDMvXd@hOk9HudbW1lAt9n8AUKQkWlnXLi1aOTZWTUHfQUEDYoSxEdAIzf8A "Wolfram Language (Mathematica) – Try It Online")
Using the bound from the [R answer](https://codegolf.stackexchange.com/a/190221/87058).
]