Skip to content

Commit d2ccf70

Browse files
committed
Typo fix: "bellow" -> "below"
1 parent 6cef4e1 commit d2ccf70

8 files changed

+25
-12
lines changed

Math/chernick-carmichael_numbers.sf

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Date: 30 March 2019
55
# https://github.com/trizen
66

7-
# Generate the extended Chernick-Carmichael numbers bellow a given limit.
7+
# Generate the extended Chernick-Carmichael numbers below a given limit.
88

99
# See also:
1010
# https://oeis.org/A317126
@@ -21,7 +21,7 @@ func is_chernick_carmichael (n, m) {
2121
: (is_prime(2**(n-2) * 9*m + 1) && __FUNC__(n-1, m))
2222
}
2323

24-
# Generate the Chernick-Carmichael bellow a given limit
24+
# Generate the Chernick-Carmichael below a given limit
2525
func chernick_carmichael_numbers(limit) {
2626

2727
var terms = []

Math/fermat_strong_primality_test.sf

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ func is_strong_fermat_pseudoprime(n, base=2) {
3838
return false
3939
}
4040

41-
say ("Primes bellow 100: ", is_strong_fermat_pseudoprime.grep(1..100))
41+
say ("Primes below 100: ", is_strong_fermat_pseudoprime.grep(1..100))
4242
say ("First 5 strong pseudoprimes to base 2: ", { !.is_prime && is_strong_fermat_pseudoprime(_, 2) }.first(5))
4343

4444
__END__
45-
Primes bellow 100: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
45+
Primes below 100: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
4646
First 5 strong pseudoprimes to base 2: [2047, 3277, 4033, 4681, 8321]

Math/hamming_numbers.sf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/ruby
22

3-
# Generate the generalized Hamming numbers bellow a certain limit, given a set of primes.
3+
# Generate the generalized Hamming numbers below a certain limit, given a set of primes.
44

55
func hamming_numbers (limit, primes) {
66

Math/left-right_truncatable_primes.sf

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# 2. Removing both digits, the number is still prime.
1414
# 3. Continuing this process, we end up with X.
1515

16-
# Full sequence for prime numbers X bellow 10:
16+
# Full sequence for prime numbers X below 10:
1717
# 2, 3, 5, 7, 131, 137, 173, 179, 373, 379, 431, 479, 673, 971, 21319, 33739, 54799, 63793, 66733, 76733, 91373, 91733, 94793, 2913739, 3667333, 9637937, 696379373, 896379373
1818

1919
# See also:

Math/modular_tetration.sf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/ruby
22

3-
# Modular computation of the tetration operation, using using Euler's theorem.
3+
# Modular computation of the tetration operation, using Euler's theorem.
44

55
# See also:
66
# https://en.wikipedia.org/wiki/Tetration

Math/primality_testing_fermat_fourier.sf

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func is_fermat_prime_3(n) {
4444
(i*n*acoth(tanh((log(1 - exp(-((i*π*exp(log(2)*n))/n))) - log(1 - exp((i*π*exp(log(2)*n))/n)))/2)))/π
4545
}
4646

47-
# Display the primes bellow 100
47+
# Display the primes below 100
4848
say (1..100 -> grep { is_fermat_prime_1(_) =~= 1 })
4949
say (1..100 -> grep { is_fermat_prime_2(_) =~= 1 })
5050
say (1..100 -> grep { is_fermat_prime_3(_) =~= 1 })

Math/primality_testing_wilson_fourier.sf

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ func is_wilson_prime_2(n) {
2828
(n*(i*log(1 - exp(-(2*i*π*Γ(n))/n)) - i*log(1 - exp((2*i*π*Γ(n))/n)) + π))/(2*π*(n-1))
2929
}
3030

31-
# Display the primes bellow 100
31+
# Display the primes below 100
3232
say (1..100 -> grep { is_wilson_prime_1(_) =~= 1 })
3333
say (1..100 -> grep { is_wilson_prime_2(_) =~= 1 })

Math/semiprime_count.sf

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
#!/usr/bin/ruby
22

3-
# Count the number of semiprimes bellow a certain limit.
3+
# Several algorithms for counting the number of semiprimes <= n.
44

55
# See also:
66
# https://en.wikipedia.org/wiki/Semiprime
77

88
func semiprime_count_1(n) {
99
var t = 0
1010
n.isqrt.primes.sum {|p|
11-
prime_count(n // p) - ++t + 1
11+
prime_count(idiv(n,p)) - ++t + 1
1212
}
1313
}
1414

1515
func semiprime_count_2(n) {
1616
n.isqrt.primes.sum {|p|
17-
prime_count(p, n // p)
17+
prime_count(p, idiv(n,p))
1818
}
1919
}
2020

21+
func semiprime_count_3(n) {
22+
23+
var t = 2*n.isqrt.primes.sum {|p|
24+
prime_count(idiv(n,p))
25+
}
26+
27+
var r = prime_count(n.isqrt)
28+
29+
(t + r - r**2)/2
30+
}
31+
2132
var n = irand(10**8)
33+
2234
say semiprime_count_1(n)
2335
say semiprime_count_2(n)
36+
say semiprime_count_3(n)

0 commit comments

Comments
 (0)