Show the (decimal) value of a number of 1s appended with a 3, then squared: Difference between revisions

Added JavaScript
(Moved Kto the right place)
(Added JavaScript)
Line 596:
1111113 1234572098769
11111113 123456832098769</syntaxhighlight>
 
=={{header|JavaScript}}==
<syntaxhighlight lang="javascript">
'use strict'
let n = 0
for( let i = 1; i < 8; i ++ )
{
let n3 = ( n * 10 ) + 3
console.log( n3 + " " + ( n3 * n3 ) )
n *= 10
n += 1
}
</syntaxhighlight>
{{out}}
<pre>
3 9
13 169
113 12769
1113 1238769
11113 123498769
111113 12346098769
1111113 1234572098769
</pre>
 
=={{header|jq}}==
3,038

edits