Consider the following code:
estratti={04,23,20,11,84};
meno=1;
menouno=estratti-meno;
base=2;
radice=IntegerDigits[89,base]
cifre=Length[radice]
max=RandomInteger[{base-1,base-1},cifre]
maxn=FromDigits[max,base]
formula89=FromDigits[radice,MixedRadix[{u,v,w,x,y,z}]]
formulamax=FromDigits[max,MixedRadix[{u,v,w,x,y,z}]]
solu=Solve[{formulamax==maxn,formula89==89,{u,v,w,x,y,z}>0},{u,v,w,x,y,z},Integers];
basi={u,v,w,x,y,z}/.solu
binari=IntegerDigits[menouno,base,cifre]
coppie=Tuples[{basi,binari}];
cinquine=Partition[FromDigits[coppie[[#,2]],MixedRadix[coppie[[#,1]]]]&/@Range[1,Length[coppie]],5];
StringRiffle[Mod[cinquine,90]+meno,"\n","."]
`I explain the steps I do:
I start with 5 numbers in the range between 1 and 90.
1st step: consists of enumerating the 90 elements of my collection from 0 to 89, as we do in cryptanalysis, subtracting -1.
2nd step: I choose the numerical base (exponential).
3rd step: I find the number of digits necessary to obtain 89 with the chosen exponential base.
4th step: calculation of the maximum number (NMAX) that can be combined with the highest number of the chosen base (base-1) and the length of digits necessary to obtain 89.
5th step: calculate the possible MIXED ROOTS (non exponential) that with that number of digits can generate the maximum number (NMAX).
6th step: I solve the system by identifying the MIXED ROOT that generates both 89 and NMAX
Step 7: starting from the 5 initial numbers converted to the chosen exponential numerical base, I apply the MIXED ROOT found and calculate 5 new numbers (from 0 to 89) MOD 90.
Step 8: add +1 to get the 5 numbers in the range from 1 to 90.
well, in base 2 I need 7 digits to get 89, and the unknowns of the mixed base are 6 {u, v, w, x, y, z}.
89 base10 = 1011001 base 2.
if I wanted to do the same calculation on base 3, the number of digits LENGTH would be 5,
89 base 10 = 10022 base 3.
MY QUESTION:
how can I automatically generate the unknowns {u, v, w, x, y, z} and replace them with {x0, x1 ... x_Length-1}?
TNK's