Let the number be x
When 1 is added to its end, the number becomes 10x + 1.
When 1 is added before the number, it becomes 1,00,000 + x.
According to the question, 10x + 1 = 3(1,00,000 + x)
10x + 1 = 3,00,000 + 3x
7x = 2,99,999
x = 42,857
Therefor, the required number is 42857.