Suppose I want to communicate an integer to a friend between 1 and 1000. In order to pass this message I use a $k$-vector whose entries can be set to $0$ or $1$. So for example if $k=3$, a natural way to express the number $7$ is $\langle 1,1,0\rangle$, where this corresponds to the binary representation $2^2+2^1+2^0$ for $7$.
However, there is a wrinkle! Before my friend can view my vector, he must pass it through a function $f_i$ which is the identity on all components not equal to $i$, and which sets the $i$-th component to $1$. For example, $f_1(\langle 1,1,0\rangle) = \langle 1,1,0\rangle$, but $f_3(\langle 1,1,0\rangle) = \langle 1,1,1\rangle$.
Critically, the value of $i$ is unknown to both me and my friend. The challenge is:
What is the smallest $k$ such that my friend can always understand my number?
My thought process:
Clearly if there were no error $k=10$ would be sufficient. If I simply wanted my friend to know if the message were changed $k=11$ would be sufficient, since I would agree to represent all numbers using a $1$-even representation (i.e. a $k$-binary with an even number of $1$s) and if my friend received an odd number he would know one of the $1$s would have been changed.
Of course he must be able to recover a garbled message. Therefore, all $1$-even vectors which could have plausibly "degenerated" into a $1$-odd vector must be considered equivalent. Therefore I think one can reduce the problem to smaller problems. Let $A^k_j$ be the set of all $k$-vectors with exactly $j$ ones. For all even $j<k$, what is the largest subset $S_j^k\subset A_j^k$ such that no two elements of $S_j^k$ can degenerate into the same vector in $A_{j+1}^k$. If we solve this, then we can sum these maximal cardinalities over all even $j$ and obtain the result.
However, it's not clear how to finish! I'm aware that this seems vaguely related to error correcting codes and Hamming distance - I think the reduced problem can plausibly be reduced to a question about subsets of the permutation group. But I can't quite figure it out...
Edit: Clearly you can let $k=22$ and just repeat your message twice, constraining the message to be 1-even. This is a crude upper bound. I am quite sure one can do much better than this...
Update: Can currently get to as low as $k=15$
I can do $k=15$ as follows: Let $\mathbf{v}$ be your original $k$-vector. First encode the message as a $1$-even message with the first $11$ digits. If the message is uncorrupted, your friend will know and you will be done. If it is corrupted, the remaining $4$ digits tell your friend the value of $\sum_{i=1}^{11} v_i \cdot i \ (\text{mod} 10),$ from which you can infer which digit was flipped.
Let me use, as usual, $k$ for the "data bits" and $n$ for the total bits sent, with $n-k$ being the redundancy.
$n=14$ bits should be enough
Take $k=10$ , $n-k=4$. Build a Hamming parity check with $n-k=4$ rows, placing the $2^4$ distinct columns, except for the null column and some extra column (I chose the all-ones column) :
$$H=\begin{pmatrix} 1&0&0&0&1&1&1&0&0&0&1&1&1&0\\ 0&1&0&0&1&0&0&1&1&0&1&1&0&1\\ 0&0&1&0&0&1&0&1&0&1&1&0&1&1\\ 0&0&0&1&0&0&1&0&1&1&0&1&1&1 \end{pmatrix}=( I_4 \mid P) $$
The corresponding generator matrix is
$$ G= (P^t \, | \, I_{10})$$
This linear code (a shortened Hamming code) has distance $d=3$ (because you need to pick at least three columns of $H$ to get a linearly dependent set), so you can correct a single error. (Not only $0\to 1$ but also $1 \to 0$)
And you can trasmit $2^k=1024$ values (more than $1000$).
Because this encoding corrects more errors than needed (we have some kind of Z-channel, instead of a BSC channel), it remains to be seen if $n$ can be further reduced.
Update. $n=13$ is not enough. There is some literature about this scenario, a (not necessarily linear) code for a Z-channel, with single-error correcting capability. Several bounds and construction methods have been found. A 1983 survey (updated in 1995) can be found in the report Error Correcting Codes for the Asymmetric Channel (Torleiv Kløve). A table in page 38, shows that, for our scenario, $n=14$ is enough for sending at least $M=1096$ messages (a slight improvement against my simple shortened Hamming code), an upper bound is $M\le 1500$. For $n=13$, an upper bound is $M\le 786$ (so we cannot send 1000 messages), and the best found construction gives only $M=586$. A more recent (2009) paper in Russian, here.