Arduino connected keypad printing wrong numbers
Transpose the pins for some of the keys and a pattern will emerge.

KEY(pin1, pin2)      transposed pins
1(2,3)        x        1(3,2)   
2(1,2)                 2(1,2)
3(2,5)        x        3(5,2)
4(3,7)                 4(3,7)
5(1,7)                 5(1,7)
6(5,7)                 6(5,7)
8(1,6)                 8(1,6)
9(5,6)                 9(5,6)
0(1,4)                 0(1,4)
#(4,5)        x        #(5,4)
*(3,4)                 *(3,4)