Problem 46943. Hash
eg: if x=127 and r = 5
1st digit 1+5=6; 2nd digit =2+5=7; 3rd digit = 7+5=12---> 3 (sum of digits 1+2 =3)
then output y= 673
if there are more inputs - consider last one as r and store output as y(1),y(2)...etc
Solution Stats
Problem Comments
-
3 Comments
Rafael S.T. Vieira
on 26 Oct 2020
I am not sure this method can be called a cipher since there is probably no way to recover the original number. You should probably call it a hash.
Sibi
on 31 Oct 2020
yeah, that's right. Thanks, I changed it to hash and changed some test cases too.
Matt Rhodes
on 25 Feb 2021
Clearly, need a new test case to eliminate solutions that define isequal() to always return true.
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
51707 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2366 Solvers
-
Back to basics 6 - Column Vector
1084 Solvers
-
371 Solvers
-
Unique values without using UNIQUE function
391 Solvers
More from this Author33
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!