Smallest square that begins with n: Difference between revisions

Content added Content deleted
(→‎bc: add)
(added Arturo)
Line 175: Line 175:
41209 4225 4356 441 45369 4624 4761 484 49
41209 4225 4356 441 45369 4624 4761 484 49
</pre>
</pre>

=={{header|Arturo}}==

<syntaxhighlight lang="arturo">loop 1..49 'n [
ns: to :string n
print [pad to :string n 2 "->" (first select.first 0..∞ 'x -> prefix? to :string x^2 ns)^2]
]</syntaxhighlight>

{{out}}

<pre> 1 -> 1
2 -> 25
3 -> 36
4 -> 4
5 -> 529
6 -> 64
7 -> 729
8 -> 81
9 -> 9
10 -> 100
11 -> 1156
12 -> 121
13 -> 1369
14 -> 144
15 -> 1521
16 -> 16
17 -> 1764
18 -> 1849
19 -> 196
20 -> 2025
21 -> 2116
22 -> 225
23 -> 2304
24 -> 2401
25 -> 25
26 -> 2601
27 -> 2704
28 -> 289
29 -> 2916
30 -> 3025
31 -> 3136
32 -> 324
33 -> 3364
34 -> 3481
35 -> 35344
36 -> 36
37 -> 3721
38 -> 3844
39 -> 3969
40 -> 400
41 -> 41209
42 -> 4225
43 -> 4356
44 -> 441
45 -> 45369
46 -> 4624
47 -> 4761
48 -> 484
49 -> 49</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==