Amicable pairs: Difference between revisions

Content deleted Content added
m →‎{{header|F Sharp|F#}}: fix heading, as suggested on the Count examples/Full list/Tier 4 talk page
Depperm (talk | contribs)
No edit summary
Line 5,939: Line 5,939:
17296:18416
17296:18416
Execution Time: 162 seconds</pre>
Execution Time: 162 seconds</pre>

=={{header|Vlang}}==
{{trans|Go}}
<lang Go>fn pfac_sum(i int) int {
mut sum := 0
for p := 1;p <= i/2;p++{
if i%p == 0 {
sum += p
}
}
return sum
}

fn main(){
a := []int{len: 20000, init:pfac_sum(it)}
println('The amicable pairs below 20,000 are:')
for n in 2 .. a.len {
m := a[n]
if m > n && m < 20000 && n == a[m] {
println('${n:5} and ${m:5}')
}
}
}</lang>

{{output}}
<pre>
The amicable pairs below 20,000 are:
220 and 284
1184 and 1210
2620 and 2924
5020 and 5564
6232 and 6368
10744 and 10856
12285 and 14595
17296 and 18416

</pre>



=={{header|Wren}}==
=={{header|Wren}}==