Skip to main content
2 of 2
Commonmark migration

Swift, 76 bytes

import Foundation
for i in 1...9{print(Int(pow((pow(10,Double(i))-1)/9,2)))}

Try it online!

If printing as an array of lines is allowed, here is 74 byte approach:

import Foundation
print((1...9).map{Int(pow((pow(10,Double($0))-1)/9,2))})

Try it online!

Mr. Xcoder
  • 42.5k
  • 9
  • 81
  • 214