ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1209. 1, 10, 100, 1000...

1s are located at (i-th Tri-angular number + 1)th position
Posted by A. A. Noman Ansary 23 Dec 2020 01:12
Number of zeros in bracket:  0     1     2      3      4
Sequence                  : (1)   (10)  (100)  (1000)  (10000)
1 is found at             : T0+1   T1+1  T3+1   T4+1    T5+1
Value of Ti+1             : 0+1    1+1   3+1    6+1     10+1

The i-th triangular number is the sum of the i natural numbers from 1 to i.

Ti = i(i+1)/2

i-th '1' is located at (Ti+1)-th position.
Let, z = (Ti + 1) = (i(i+1)/2) + 1
-> z = (i^2 + i + 2)/2
-> 2z = i^2 + i + 2
-> (1)x(i^2) + (1)x(i^1) + (-2(z-1)x(i^0) = 0
So, now if we solve for i using quadratic formula,
 i = (-1 +- squareRoot(8z-7))/2 [do calculation on your own]
z = {1,2,4,7,11,...}
plugin these values and you will find that squareRoot(8z-7) = an integersquare number for any z. So, a number belongs to z only and if only squareRoot(8z-7) can produce an integer. And here z is the position number where the digits are 1.

[code deleted]

Edited by author 24.12.2020 19:00

Edited by moderator 14.02.2021 18:16