Show the (decimal) value of a number of 1s appended with a 3, then squared: Difference between revisions
Show the (decimal) value of a number of 1s appended with a 3, then squared (view source)
Revision as of 18:56, 28 July 2021
, 2 years agoAdded Sidef
m (→{{header|Python}}: Giving the output format) |
(Added Sidef) |
||
Line 697:
1111113 1234572098769
11111113 123456832098769
</pre>
=={{header|Sidef}}==
<lang ruby>0..^8 -> each {|n|
var k = ((10**(n+1) - 1)/9 + 2)
say [k, k**2]
}</lang>
{{out}}
<pre>
[3, 9]
[13, 169]
[113, 12769]
[1113, 1238769]
[11113, 123498769]
[111113, 12346098769]
[1111113, 1234572098769]
[11111113, 123456832098769]
</pre>
|