And I dont even know how you could use a formula... ah well.. trial and error does work sometimes.
Last six digits are 173518 as total resulting number is
Bearing in mind you needed 6 digits at least, so number would need 9(?) 5's at least.
I just used trial and error....