Skip to content

Commit

Permalink
modified: Math/count_of_smooth_numbers.sf
Browse files Browse the repository at this point in the history
modified:   Math/count_of_smooth_numbers_2.sf
  • Loading branch information
trizen committed Sep 21, 2023
1 parent dc3769b commit 0d1dc0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Math/count_of_smooth_numbers.sf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ func smooth_count(n, p) {
}

for p in (primes(15)) {
say ("Ψ(10^n, #{p}) for n < 10: ", 10.range.map { smooth_count(10**_, p) })
var arr = 10.range.map {|n| smooth_count(10**n, p) }
assert_eq(arr, 10.range.map {|n| p.smooth_count(10**n) })
say ("Ψ(10^n, #{p}) for n < 10: ", arr)
}

__END__
Expand Down
4 changes: 3 additions & 1 deletion Math/count_of_smooth_numbers_2.sf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ func smooth_count(n, k) {
}

for p in (primes(15)) {
say ("Ψ(10^n, #{p}) for n < 10: ", 10.range.map { smooth_count(10**_, p) })
var arr = 10.range.map {|n| smooth_count(10**n, p) }
assert_eq(arr, 10.range.map {|n| p.smooth_count(10**n) })
say ("Ψ(10^n, #{p}) for n < 10: ", arr)
}

__END__
Expand Down

0 comments on commit 0d1dc0d

Please sign in to comment.