The digits 0 to 9 are encoded by 9467128053.
This is one possible logical path to a solution. We’ll use the notation 1ac (as in the clues) to refer to the coded grid entries, and [1ac] to refer to entries in their uncoded form.
The top and bottom rows consist of the ten distinct digits, so 1ac, 4ac, 19ac and 20ac (grid entries) have no repeated digits among them, and the same is true for their uncoded forms [1ac], [4ac], [19ac] and [20ac].
Since their square roots are used in other clues, we know that 1ac, 20ac and 12dn are all squares. [1ac] (uncoded) is also a square, equal to 20ac (coded). [1dn] and [3dn] are both roots of 3-digit squares, so they must each start with one of {1, 2, 3}. The first digit of [3dn] is the last digit of [1ac], its square, so it must be 1 (no squares end with 2 or 3). The only squares starting with {1, 2, 3} and ending with 1 are 121 and 361; to have distinct digits, [1ac] = 361, so 20ac = 361 and [3dn] = 19, its square root.
The only place now available for the 0 in the top and bottom rows is the second digit of 19ac. That means [4ac] ends in 0 and [5dn] begins with 0; but that doesn’t break the rules because [5dn] isn’t a clue answer.
1ac is a square that encodes 361 and shares none of its digits, so it’s one of {289, 529, 729, 784}; thus 1 is coded by 9 or 4. [18dn] is the reverse of its coded form, 18dn, which we know ends in 1, so whatever digit codes 1 is also coded by 1. If this digit were 9, [18dn] would be 19, but that value is already taken by [3dn], so [18dn] = 14 and 18dn = 41. Since 1 is coded by 4, [1ac] = 361 can now only be coded as 1ac = 784, so [16dn] = 28, its square root.
The uncoded versions of the top and bottom rows are now 361_0 and 8___4 respectively, leaving only {2, 5, 7, 9} unplaced. [15dn] is even, so it must end in the 2, which is coded by the 6 we already have in the grid. [20ac] is now _24 and the remaining options for its first digit mean it’s one of {524, 724, 924}; thus it’s a multiple of 4 but not of 8. It’s also a multiple of 17dn, which is _3, so it must be 17dn multiplied by a number n that ends in 8; since 17dn has no even factors, n must be a multiple of 4 but not of 8, ie, one of {28, 68} (108 is too big to give a three-digit product). The only combination that works is 33 × 28 = 924, so [20ac] = 924 and 17dn = 33, so [17dn] = 99.
The remaining (coded) digits for 4ac and 19ac are {2, 5, 9}. Since [17dn] = 99 is a multiple of the sum of the digits of 4ac, 4ac is one of {29, 92}. That leaves 5 for the start of 19ac, so 19ac = 50 (and we now know that 8 is coded by 5) and [4ac] = 50. The only unplaced digit in the uncoded versions of the top and bottom rows is now 7, so it must be the second digit of [19ac], encoded by 0.
[1dn] is one of {30, 31} and its square is 12dn, one of {900, 961}, so 16ac is one of {603, 613}, making its uncoded form [16ac] one of {279, 249} respectively, whose prime factorisations are 279 = 3 × 3 × 31 and 249 = 3 × 83. [16ac] is a multiple of 5dn, which is 2_ or 9_; the only possible factor in the 20s or 90s is from 279 = 3 × 93. Therefore, 5dn = 93, [16ac] = 279, 16ac = 603, 12dn = 900, [1dn] = 30 and 4ac = 29. The top and bottom rows are now complete and we have the complete encoding of 0123456789 to 9467128053.
[6ac] is 12dn = 900 plus a square. [3dn] and [5dn] both end in 9, so [6ac] is 9_9, which can only be one of {909, 949}. But 909 would make the clue answer [7dn] start with 0, so [6ac] = 949, encoded by 6ac = 313. [9dn] = 12ac − 7dn and we have 12ac = 9__ and 7dn = 1__ (both ending in the same digit), so [9dn] starts with 7 or 8; it can’t be 7 because the coded entry would then begin with 0, so [9dn] is 8_0, encoded as 5_9.
We have 8ac + 8dn = [2dn] starting with 6, so 8ac and 8dn start with 3. [13ac] = 8ac − 8dn ends with 7 and 8ac ends with 5, so 8dn ends in 8, which makes 13ac = 80, [13ac] = 67. [2dn] is now 3_5 + 3_8, so it ends in 3, coded as 7, which makes 8ac = 375 and 8dn = 308 (= 375 − 67); then [2dn] = 683 (= 375 + 308), coded as 2dn = 857.
We now have digits totalling 120 in the grid and 8 empty cells, so the maximum possible sum is 120 + 8 × 9 = 192, which means [11dn] starts with 1, coded as 4; thus 10ac ends in 4. [15dn] ends in 2 and is 10ac × an even number, so the multiplier must end in 8.
Using letters to stand for the missing digits, if 12ac = 9PX and 7dn = 1QX, the middle digit of [9dn] is P − Q, and it’s coded by P. The digits that are coded by higher digits are 0 → 9, 1 → 4, 2 → 6, 3 → 7 and 6 → 8; the corresponding values for Q are 9 − 0 = 9, 4 − 1 = 3, 6 − 2 = 4, 7 − 3 = 4 and 8 − 6 = 2. That makes 10ac one of {24, 34, 44, 94}. We can rule out 94 because the only possibility for [15dn] would be 94 × 8 = 752, coded by 026, but 15dn mustn’t start with 0.
[7dn] is 4__ (coded as 1__) and has the same digits as 14ac, which starts with 9, so 7dn must contain a 3 somewhere. If 10ac is 44, 7dn must be 143, so [7dn] is 419, 14ac is 941 or 914, 15dn starts with 4 or 1, and [15dn] is 1_2 or 4_2. 44 × 8 = 352 and 44 × 18 = 792, so there are no matches for [15dn]. So 10ac isn’t 44.
If 10ac is 24, 7dn must be 123, so [7dn] is 459, 14ac is 945 or 954, 15dn starts with 4 or 5, and [15dn] is 1_2 or 8_2. The only possibility that’s a suitable multiple of 24 is 24 × 8 = 192, coded as 436, with 945 for 14ac. With 12ac filled in as 983, that gives a digit total of 149 + the middle digit of 11dn, which is 4_5. To fit 1_8, [11dn] could only be 158, coded as 425, but 149 + the middle digit 2 only comes to 151. So 10ac isn’t 24.
The only value left for 10ac is 34, so 7dn is 13X and 12ac is 94X (and [9dn] = 94X − 13X = 810, coded as 549). The multiples of 34 that would match [15dn] are 34 × 8 = 272, 34 × 18 = 612 and 34 × 28 = 952, coded respectively as 606, 846 and 326. Since 14ac is a permutation of [7dn], which is 49_, 14ac must contain a 4 somewhere; none of the possibilities for 15dn starts with 4, so the 4 must be the last digit of 14ac, so [11dn] is 1_1.
If 15dn is 326, 14ac is 934, so [7dn] is 493, coded as 137. The digit total is then 147 + the middle digit of 11dn, which must be 4 to make the total of 151; but 151 is coded as 424, whose middle digit isn’t 4, so 15dn isn’t 326.
If 15dn is 846, 14ac is 984, so [7dn] is 498, coded as 135. The digit total is then 152 + the middle digit of 11dn, which must be 9 to make the total of 161; but 161 is coded as 484, whose middle digit isn’t 9, so 15dn isn’t 846.
Therefore, 15dn = 606, 14ac = 964, [7dn] = 496 and 7dn = 138. The digit total is 149 + the middle digit of 11dn, which must be 2 to make the total of [11dn] = 151, which is coded as 11dn = 424, with the expected middle digit. The grid is now complete.