2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -0,0 +1,16 @@
$url = "https://oeis.org/A000045/b000045.txt"
$file = "$env:TEMP\FibonacciNumbers.txt"
(New-Object System.Net.WebClient).DownloadFile($url, $file)
$benford = Get-Content -Path $file |
Select-Object -Skip 1 -First 1000 |
ForEach-Object {(($_ -split " ")[1].ToString().ToCharArray())[0]} |
Group-Object |
Select-Object -Property @{Name="Digit" ; Expression={[int]($_.Name)}},
Count,
@{Name="Actual" ; Expression={$_.Count/1000}},
@{Name="Expected"; Expression={[double]("{0:f5}" -f [Math]::Log10(1 + 1 / $_.Name))}}
$benford | Sort-Object -Property Digit | Format-Table -AutoSize
Remove-Item -Path $file -Force -ErrorAction SilentlyContinue