Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
19
Task/Bell-numbers/PowerShell/bell-numbers.ps1
Normal file
19
Task/Bell-numbers/PowerShell/bell-numbers.ps1
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Bell numbers
|
||||
[uint32]$script:MaxN = 14
|
||||
$a = [uint32[]]::new($script:MaxN)
|
||||
foreach ($i in 0..($script:MaxN - 1)) {
|
||||
$a[$i] = 0
|
||||
}
|
||||
[uint32]$n = 0
|
||||
$a[0] = 1
|
||||
[string]$row = "B({0, 2}) = {1,9}" -f $n, $a[0]
|
||||
Write-Output $row
|
||||
while ($n -lt $script:MaxN) {
|
||||
$a[$n] = $a[0]
|
||||
foreach ($j in $n..1) {
|
||||
$a[$j - 1] += $a[$j]
|
||||
}
|
||||
$n++
|
||||
[string]$row = "B({0, 2}) = {1,9}" -f $n, $a[0]
|
||||
Write-Output $row
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue