Triangle Quest

Sort by

recency

|

1027 Discussions

|

  • + 0 comments

    n = int(input()) for i in range(1, n): print(i * (10**i - 1) // 9)

  • + 0 comments

    Thats a math question.

  • + 0 comments

    for i in range(1,int(input())): print((10**i - 1) // 9 * i)
    simple solution

  • [deleted]
    + 0 comments

    For Python3

    print(pow(10, i)//9 * i)
    
  • + 0 comments
    1. a simple maths ;
    2. we need to print i*(1+10^1 +10^2 ........10^i)
    3. using gp formula we get: i*((10^i - 1)/9)
    4. then you can 'iiiii....itimes'