Levenshtein distance & OEIS (Cops) This is the Cop post. The Robber post is here.



Your task is to take an integer input N and output the Nth digit in the sequence OEIS A002942.

The sequence consists of the square numbers written backwards:

1, 4, 9, 61, 52, 63, 94, 46, 18, 1, 121, 441, ...


Note that leading zeros are trimmed away (100 becomes 1, not 001). Concatenating this into a string (or one long number gives):

1496152639446181121441


You shall output the Nth digit in this string/number. You may choose to take N as 0-indexed or 1-indexed (please state which one you choose).

Test cases (1-indexed):

N = 1,      ==&gt; 1
N = 5,      ==&gt; 1
N = 17,     ==&gt; 1   &lt;- Important test case! It's not zero.
N = 20,     ==&gt; 4
N = 78,     ==&gt; 0
N = 100,    ==&gt; 4


Your code should work for numbers up to N = 2^15 (unless your language can't handles 32 bit integers by default, in which case N can be lower). 



Cops:

You must write two functions/programs, in the same language, that do the same thing. You have to post one of the functions/programs, as well as the Levenshtein distance between the two functions/programs you have written. The Levenshtein distance is measured in characters (so addition of a two byte character will give a LD = 1).

The unrevealed code can not be longer than the original solution (but it can be the same size). The robbers will attempt to write a code with the exact Levenshtein distance you gave (it can be different from your unrevealed code, as long as it works).

The winner will be the uncracked submission that has the lowest Levenshtein distance.

You may check the Levenshtein distance here!



If your submission goes uncracked for 7 days then you may reveal the alternative code you have written and mark your submission as safe.
Haskell, LD = 13, cracked



((snd.span(&lt;'1').reverse.show.(^2)=&lt;&lt;[1..])!!)


Try it online! 

I double-checked that leading zeros are trimmed ;)

Explanation:

                    [1..]     -- for each element in [1,2,3,4,5,...]
                 =&lt;&lt;          -- apply the following functions 
             (^2)             -- square [1,4,9,16,25,...]
           show.              -- convert to string ["1","4","9","16","25",...]
       reverse.               -- reverse ["1","4","9","61","52",...,"001",...]
   span(&lt;'1').                -- split into leading zeros and remainder [("","1"),("","4"),...,("00","1"),...]
  snd.                        -- only keep remainder ["1","4","9","61","52",...,"1",...]
                              -- and concatenate the result "1496152..."
((                       )!!) -- index into the sequence