GenerateChallengeExamples[f_,secret_, m_, k_]:= 
Table[ Flatten[Append[#,f[secret[[#]]]]]&/@ {Table[RandomInteger[{1,Length[secret]}],{j,1,k}]},{i,1,m} ] ;
GenerateChallenges[s_,m_,k_]:=Table[Table[RandomInteger[{1,s}],{j,1,k}],{i,1,m} ] ;

(* Human Computable Functions *)

Basic[x_]:=Mod[ x[[Mod[x[[11]]+x[[12]],10]+1]] + x[[13]] + x[[14]] , 10];
BasicTweaked[x_]:=Mod[ x[[Mod[x[[11]],10]+1]] +x[[12]]+ x[[13]] + x[[14]] , 10];

(* We used different randomness sources to generate the secret mappings for the actual challenge *)

SeedRandom[123456];
basicSecret100 =Table[RandomInteger[{0,9}],{i,1,100}];

SeedRandom[1234567];
basicSecretTweaked100 =Table[ RandomInteger[{0,9}],{i,1,100}];

SeedRandom[12345678];
(* PresolvedBasicChallenge-100-500-Examples.txt *)
basicChallenge500ResponsePairs = GenerateChallengeExamples[Basic,basicSecret100,500,14];
(* PresolvedBasicChallenge-100-500-Passwords.txt *)
basicChallengePasswordsFile = GenerateChallenges[Length[basicSecret100],200,14];
(* PresolvedBasicTweakedChallenge-100-500-Examples.txt *)
basicTweakedChallenge500ResponsePairs = GenerateChallengeExamples[Basic,basicSecretTweaked100,500,14];
(* PresolvedBasicTweakedChallenge-100-500-Passwords.txt *)
basicTweakedChallengePasswordsFile = GenerateChallenges[Length[basicSecretTweaked100],200,14];

basicTweakedChallenge500ResponsePairs