777 in Base k

 The three digit number 777 in base k is equivalent to 4145 in base 8. What is k?