numb 0.181.0 → 0.184.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/numb/divisors.rb +65 -4
- data/lib/numb/dudeney.rb +1 -3
- data/lib/numb/inrt.rb +12 -0
- data/lib/numb/inv_mod.rb +6 -0
- data/lib/numb/ord.rb +29 -0
- data/lib/numb/power_mod.rb +15 -0
- data/spec/numb/dudeney_spec.rb +1 -1
- data/spec/numb/exceptional_spec.rb +36 -0
- data/spec/numb/inrt_spec.rb +42 -0
- data/spec/numb/inv_mod_spec.rb +27 -0
- data/spec/numb/ord_spec.rb +72 -0
- data/spec/numb/power_mod_spec.rb +45 -0
- data/spec/numb/xgcd_spec.rb +25 -0
- metadata +253 -222
- /data/spec/{spec.opts → .rspec} +0 -0
data/.gitignore
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.184.0
|
data/lib/numb/divisors.rb
CHANGED
@@ -65,6 +65,22 @@ class Integer
|
|
65
65
|
alias :⊥ :coprime?
|
66
66
|
alias :stranger? :coprime?
|
67
67
|
|
68
|
+
# An enumeration of numbers coprime to `x` from `self` onward. If a
|
69
|
+
# block is given, it is yielded to with the next number in the
|
70
|
+
# sequence; otherwise, an `Enumerator` is returned.
|
71
|
+
#
|
72
|
+
# 4.coprime(3).first(5) #=> [4, 5, 7, 8, 10]
|
73
|
+
#
|
74
|
+
# @param [Integer] x each number in the enumeration is coprime with `x`
|
75
|
+
# @yield [Integer] n next number that is >= `self` and coprime with `x`
|
76
|
+
# @return [Enumerator] returned if the block is omitted
|
77
|
+
def coprime(x)
|
78
|
+
return enum_for(__method__, x) unless block_given?
|
79
|
+
(self..Float::INFINITY).each do |n|
|
80
|
+
yield n if n.coprime?(x)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
68
84
|
# A deficient number is a number n for which σ(n) < 2n. That is, the sum of
|
69
85
|
# its divisors are less than the number. (To calculate the sum of divisors
|
70
86
|
# for an arbitrary integer see Integer#σ).
|
@@ -347,10 +363,13 @@ class Integer
|
|
347
363
|
limit = Prime.first(pf.size).zip(pf.reverse).map{|b,e| b**(e-1)}.reduce(:*)
|
348
364
|
neighbour = ->(e) { (self/e).divisors.reject{|d| d > e} }
|
349
365
|
x, div, exponents = self, divisors, {}
|
350
|
-
|
351
366
|
Prime.each do |b|
|
352
|
-
|
353
|
-
|
367
|
+
d = begin
|
368
|
+
max_exponent = Math.log(limit, b).floor
|
369
|
+
div.reject{|d| d > max_exponent}
|
370
|
+
rescue FloatDomainError
|
371
|
+
div
|
372
|
+
end.sort.reverse - [1]
|
354
373
|
unless b == 2
|
355
374
|
prev_neighbours = exponents[exponents.keys.last].values.flatten
|
356
375
|
d.reject!{|e, n| not prev_neighbours.include?(e)}
|
@@ -358,7 +377,6 @@ class Integer
|
|
358
377
|
exponents[b] = Hash[d.map{|e| [e, neighbour.(e)]}]
|
359
378
|
break if (x /= b) < 1
|
360
379
|
end
|
361
|
-
|
362
380
|
complete_chain = ->(b, e, goal=self, chain=nil) do
|
363
381
|
chain ||= {chain: [[b, e]]}
|
364
382
|
return chain unless exponents.key?(b) and exponents[b].key?(e)
|
@@ -422,4 +440,47 @@ class Integer
|
|
422
440
|
k**2 * (35 * k**2 - 52 * k * n + 18 * n**2) * k.σ * (n-k).σ
|
423
441
|
end.reduce(:+)
|
424
442
|
end
|
443
|
+
|
444
|
+
def ordinary?
|
445
|
+
return true if self == 1
|
446
|
+
pf = prime_factors.sort.reverse
|
447
|
+
Prime.first(pf.size).
|
448
|
+
zip(pf).
|
449
|
+
map{|b,e| b**(e-1)}.
|
450
|
+
reduce(:*) == first_with_n_divisors
|
451
|
+
end
|
452
|
+
|
453
|
+
def exceptional?
|
454
|
+
not ordinary?
|
455
|
+
end
|
456
|
+
|
457
|
+
# Computes the extended greatest common divisor of `self` and `b`
|
458
|
+
#
|
459
|
+
# The extended Euclidean algorithm is an extension to the Euclidean
|
460
|
+
# algorithm for finding the GCD of integers `a` and `b`: it also
|
461
|
+
# finds the integers `x` and `y` in Bézout's identity:
|
462
|
+
#
|
463
|
+
# ax + by = gcd(a, b)
|
464
|
+
#
|
465
|
+
# This method takes `self` as `a`, and `b` as an argument, and
|
466
|
+
# returns their GCD, `x`, and `y`
|
467
|
+
#
|
468
|
+
# For example, `21.xgcd(48)` is `[3, 7, -3]` because `21.gcd(48)` is
|
469
|
+
# `3`, and `21 * 7 + 48 * -3` is `3`.
|
470
|
+
#
|
471
|
+
# 3.xgcd(-65) #=> [1, 22, 1]
|
472
|
+
# 56.xgcd(72) #=> [8, 4, -3]
|
473
|
+
#
|
474
|
+
# @param [Integer] b the number `self` is divided by
|
475
|
+
# @returns [Array<Integer>] GCD, `x`, and `y`
|
476
|
+
def xgcd b
|
477
|
+
a = self
|
478
|
+
x, y, u, v = 0, 1, 1, 0
|
479
|
+
while a != 0
|
480
|
+
q, r = b/a, b%a
|
481
|
+
m, n = x-u*q, y-v*q
|
482
|
+
b, a, x, y, u, v = a, r, u, v, m, n
|
483
|
+
end
|
484
|
+
self < 0 ? [b, x, y].map(&:-@) : [b, x, y]
|
485
|
+
end
|
425
486
|
end
|
data/lib/numb/dudeney.rb
CHANGED
@@ -10,8 +10,6 @@ class Integer
|
|
10
10
|
# 98.dudeney? #=> false
|
11
11
|
#
|
12
12
|
def dudeney?
|
13
|
-
|
14
|
-
# yet to understand why.
|
15
|
-
Math.cbrt(self).to_s.sub(/\.0$/,'') == self.digits.reduce(:+).to_s
|
13
|
+
digits.reduce(:+) ** 3 == self
|
16
14
|
end
|
17
15
|
end
|
data/lib/numb/inrt.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
class Integer
|
2
|
+
# Returns the integer `n`'th root of the absolute value of `self`.
|
3
|
+
#
|
4
|
+
# (0..12).map{|n| (4**n).inrt(3)}
|
5
|
+
# #=> [1, 1, 2, 4, 6, 10, 16, 25, 40, 64, 101, 161, 256]
|
6
|
+
#
|
7
|
+
# @param [Integer] n root to take of `self`
|
8
|
+
# @return [Integer] The `n`th root of `self`
|
9
|
+
def inrt n
|
10
|
+
(abs ** Rational(1, n)).round(5).floor
|
11
|
+
end
|
12
|
+
end
|
data/lib/numb/inv_mod.rb
ADDED
data/lib/numb/ord.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
class Integer
|
3
|
+
# Returns the multiplicative order of `self` % `m`, or `nil` if
|
4
|
+
# `self` is not coprime to `m`
|
5
|
+
#
|
6
|
+
# Given an integer `self` and a positive integer `m` with gcd(`a`,
|
7
|
+
# `m`) = 1, the multiplicative order of `self` modulo `m` is the
|
8
|
+
# smallest positive integer `k` with: `self`^`k` ≡ 1 (modulo `m`).
|
9
|
+
#
|
10
|
+
# @param [Integer] m the modulus
|
11
|
+
# @return [Integer, nil] the power, `k`, or `nil` if `self` and `m` are not coprime
|
12
|
+
def ord(m)
|
13
|
+
return unless coprime?(m)
|
14
|
+
m.prime_division.inject(1) do |result, f|
|
15
|
+
(p, k), r = f, 1
|
16
|
+
pk = p ** k
|
17
|
+
# We could calculate the totient here as `(p - 1) * p ** (k -
|
18
|
+
# 1)`, but it feels cleaner to separate the logic
|
19
|
+
(t = pk.φ).prime_division.each do |q, e|
|
20
|
+
x = power_mod(t / q ** e, pk)
|
21
|
+
while x != 1
|
22
|
+
r *= q
|
23
|
+
x = x.power_mod(q, pk)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
result.lcm(r)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class Integer
|
2
|
+
# `self`^`b` mod `m`
|
3
|
+
#
|
4
|
+
# @param [Integer] b power to which `self` should be raised
|
5
|
+
# @param [Integer] m modulus
|
6
|
+
# @return [Integer] `self`^`b` % `m`
|
7
|
+
def power_mod(b, m)
|
8
|
+
result = 1
|
9
|
+
b.to_s(2).chars.each do |bit|
|
10
|
+
result = (result * result) % m
|
11
|
+
result = (result * self) % m if bit==?1
|
12
|
+
end
|
13
|
+
result
|
14
|
+
end
|
15
|
+
end
|
data/spec/numb/dudeney_spec.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# A072066
|
4
|
+
A072066 = [8,16,24,32,48,64,72,80,96,108,112,128,144,160,
|
5
|
+
162,176,192,208,216,224,243,256,272,288,304,320,
|
6
|
+
324,352,368,384,416,432,448,464,480,486,496,512,
|
7
|
+
544,576,592,608,640,648,656,672,688,704,729,736,
|
8
|
+
752,768,832,848]
|
9
|
+
|
10
|
+
describe Integer, "#exceptional?" do
|
11
|
+
A072066.sample(10).each do |n|
|
12
|
+
it "returns true for exceptional number #{n}" do
|
13
|
+
n.should be_exceptional
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
([*(1..7)] + A072066.to_seq.invert.to_a).sample(10).each do |n|
|
18
|
+
it "returns false for ordinary number #{n}" do
|
19
|
+
n.should_not be_exceptional
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe Integer, "#ordinary?" do
|
25
|
+
([*(1..7)] + A072066.to_seq.invert.to_a).sample(10).each do |n|
|
26
|
+
it "returns true for ordinary number #{n}" do
|
27
|
+
n.should be_ordinary
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
A072066.sample(10).each do |n|
|
32
|
+
it "returns false for exceptional number #{n}" do
|
33
|
+
n.should_not be_ordinary
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
describe Integer, "#inrt" do
|
3
|
+
@seq = {
|
4
|
+
# A017922
|
5
|
+
2 => [1,2,6,14,36,88,216,529,1296,3174,7776,19047,
|
6
|
+
46656,114283,279936,685700,1679616,4114202,
|
7
|
+
10077696,24685212,60466176,148111277,362797056,
|
8
|
+
888667667,2176782336,5332006004,13060694016].map.with_index{|n,i| [6**i, n]},
|
9
|
+
|
10
|
+
# A017985
|
11
|
+
3 => [1,1,2,4,6,10,16,25,40,64,101,161,256,406,645,
|
12
|
+
1024,1625,2580,4096,6501,10321,16384,26007,41285,
|
13
|
+
65536,104031,165140,262144,416127,660561,1048576,
|
14
|
+
1664510,2642245,4194304,6658042].map.with_index{|n,i| [4**i, n]},
|
15
|
+
|
16
|
+
# A018051
|
17
|
+
4 => [1,1,1,2,3,3,5,6,9,11,15,20,27,35,46,61,81,106,
|
18
|
+
140,184,243,319,420,553,729,959,1262,1661,2187,
|
19
|
+
2878,3787,4985,6561,8634,11363,14955,19683,25904,
|
20
|
+
34091,44867,59049,77712].map.with_index{|n,i| [3**i, n]},
|
21
|
+
|
22
|
+
# A018132
|
23
|
+
5 => [1,1,2,3,4,7,10,15,22,33,49,72,106,157,232,343,
|
24
|
+
506,747,1102,1626,2401,3543,5229,7717,11388,16807,
|
25
|
+
24803,36604,54019,79720,117649,173623,256228,
|
26
|
+
378135,558041,823543].map.with_index{|n,i| [7**i, n]},
|
27
|
+
|
28
|
+
# A017979
|
29
|
+
6 => [1,1,1,2,2,3,4,5,6,8,10,12,16,20,25,32,40,50,64,
|
30
|
+
80,101,128,161,203,256,322,406,512,645,812,1024,
|
31
|
+
1290,1625,2048,2580,3250,4096,5160,6501,8192,
|
32
|
+
10321,13003,16384,20642].map.with_index{|n,i| [4**i, n]},
|
33
|
+
}
|
34
|
+
|
35
|
+
@seq.each do |n, seq|
|
36
|
+
seq.each do |x, rt|
|
37
|
+
it "returns #{rt} for #{x}.inrt(#{n})" do
|
38
|
+
x.inrt(n).should == rt
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
describe Integer, "#inv_mod" do
|
3
|
+
# A102057
|
4
|
+
# -----b------> # |
|
5
|
+
@seq = [[ 1], # |
|
6
|
+
[ 1, 2], # m
|
7
|
+
[ 1,nil, 3], # |
|
8
|
+
[ 1, 3, 2, 4], # |
|
9
|
+
[ 1,nil,nil,nil, 5], # V
|
10
|
+
[ 1, 4, 5, 2, 3, 6],
|
11
|
+
[ 1,nil, 3,nil, 5,nil, 7],
|
12
|
+
[ 1, 5,nil, 7, 2,nil, 4, 8],
|
13
|
+
[ 1,nil, 7,nil,nil,nil, 3,nil, 9],
|
14
|
+
[ 1, 6, 4, 3, 9, 2, 8, 7, 5, 10],
|
15
|
+
[ 1,nil,nil,nil, 5,nil, 7,nil,nil,nil, 11],
|
16
|
+
[ 1, 7, 9, 10, 8, 11, 2, 5, 3, 4, 6, 12],
|
17
|
+
[ 1,nil, 5,nil, 3,nil,nil,nil, 11,nil, 9,nil, 13],
|
18
|
+
[ 1, 8,nil, 4,nil,nil, 13]]
|
19
|
+
|
20
|
+
@seq.each.with_index(2) do |ms, m|
|
21
|
+
ms.each.with_index(1) do |inv, b|
|
22
|
+
it "returns #{inv} for #{b}.inv_mod(#{m})" do
|
23
|
+
b.inv_mod(m).should == inv
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
describe Integer, "#ord" do
|
3
|
+
@seq = {
|
4
|
+
# A002326
|
5
|
+
2 => [1,2,4,3,6,10,12,4,8,18,6,11,20,18,28,5,10,12,36,
|
6
|
+
12,20,14,12,23,21,8,52,20,18,58,60,6,12,66,22,35,
|
7
|
+
9,20,30,39,54,82,8,28,11,12,10,36,48,30,100,51,12,
|
8
|
+
106,36,36,28,44,12,24,110,20,100,7,14,130,18,36,
|
9
|
+
68,138,46,60,28].map.with_index{|k, i| [2*i + 1, k]},
|
10
|
+
# A050975
|
11
|
+
3 => 2.coprime(3).first(74).zip([1,2,4,6,2,4,5,3,6,4,16,18,4,5,
|
12
|
+
11,20,3,6,28,30,8,16,12,18,18,4,8,42,10,11,23,42,20,6,52,20,
|
13
|
+
6,28,29, 10,30,16,12,22,16,12,35,12,18,18,30,78,4,8,41,16,
|
14
|
+
42,10,88,6,22,23,36,48,42,20,100,34,6,52,53,27,20, 12]),
|
15
|
+
# A050976
|
16
|
+
4 => 2.coprime(4).first(78).zip([1,2,3,3,5,6,2,4,9,3,11,10,9,14,5,5,6,18,6,10,7,6,
|
17
|
+
23,21,4,26,10,9,29,30,3,6,33,11,35,9,10,15,39,27,
|
18
|
+
41,4,14,11,6,5,18,24,15,50,51,6,53,18,18,14,22,6,
|
19
|
+
12,55,10,50,7,7,65,9,18,34,69,23,30,14,21,74,15, 12,10,26]),
|
20
|
+
# A050977
|
21
|
+
5 => 2.coprime(5).first(81).zip([1,2,1,2,6,2,6,5,2,4,6,4,16,6,9,6,5,22,2,4,18,6,
|
22
|
+
14,3,8,10,16,6,36,9,4,20,6,42,5,22,46,4,42,16,4,
|
23
|
+
52,18,6,18,14,29,30,3,6,16,10,22,16,22,5,6,72,36,
|
24
|
+
9,30,4,39,54,20,82,6,42,14,10,44,12,22,6,46,8,96, 42,30,25,16]),
|
25
|
+
|
26
|
+
# A050978
|
27
|
+
6 => 2.coprime(6).first(67).zip([1,2,10,12,16,9,11,5,14,6,2,4,40,3,23,14,26,10,58,
|
28
|
+
60,12,33,35,36,10,78,82,16,88,12,9,12,10,102,106,
|
29
|
+
108,112,11,16,110,25,126,130,18,136,23,60,14,37,
|
30
|
+
150,6,156,22,27,83,156,43,10,178,60,4,80,19,96,14, 198,14]),
|
31
|
+
|
32
|
+
# A050979
|
33
|
+
7 => 2.coprime(7).first(81).zip([1,1,2,4,1,2,3,4,10,2,12,4,2,16,3,3,4,10,22,2,4,
|
34
|
+
12,9,7,4,15,4,10,16,6,9,3,12,4,40,6,10,12,22,23,2,
|
35
|
+
4,16,12,26,9,20,3,7,29,4,60,15,8,12,10,66,16,22,
|
36
|
+
70,6,24,9,4,6,12,78,4,27,40,41,16,6,7,10,88,12,22, 15,23,12]),
|
37
|
+
# A050980
|
38
|
+
8 => 2.coprime(8).first(75).zip([2,4,1,2,10,4,4,8,6,2,11,20,6,28,5,10,4,12,4,20,
|
39
|
+
14,4,23,7,8,52,20,6,58,20,2,4,22,22,35,3,20,10,13,
|
40
|
+
18,82,8,28,11,4,10,12,16,10,100,17,4,106,12,12,28,
|
41
|
+
44,4,8,110,20,100,7,14,130,6,12,68,46,46,20,28,14, 148,5]),
|
42
|
+
|
43
|
+
# A050981
|
44
|
+
9 => 2.coprime(9).first(82).zip([1,1,2,3,1,2,5,3,3,2,8,9,2,5,11,10,3,3,14,15,4,8,
|
45
|
+
6,9,9,2,4,21,5,11,23,21,10,3,26,10,3,14,29,5,15,8,
|
46
|
+
6,11,8,6,35,6,9,9,15,39,2,4,41,8,21,5,44,3,11,23,
|
47
|
+
18,24,21,10,50,17,3,26,53,27,10,6,56,22,14,29,24, 5,5,15]),
|
48
|
+
|
49
|
+
# A002329
|
50
|
+
10 => 2.coprime(10).first(52).zip([1,6,1,2,6,16,18,6,22,3,28,15,2,3,6,5,21,46,42,16,
|
51
|
+
13,18,58,60,6,33,22,35,8,6,13,9,41,28,44,6,15,96,
|
52
|
+
2,4,34,53,108,3,112,6,48,22,5,42,21,130])
|
53
|
+
|
54
|
+
}
|
55
|
+
|
56
|
+
@seq.each do |a, seq|
|
57
|
+
seq.each do |n, k|
|
58
|
+
it "returns #{k} for #{a}.ord(#{n})" do
|
59
|
+
a.ord(n).should == k
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
it "returns nil for #{a}.ord(#{a})" do
|
64
|
+
a.ord(a).should be_nil
|
65
|
+
end
|
66
|
+
|
67
|
+
b = a * rand(100)
|
68
|
+
it "returns nil for #{a}.ord(#{b})" do
|
69
|
+
a.ord(b).should be_nil
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
describe Integer, "#power_mod" do
|
3
|
+
@seq = {
|
4
|
+
# A015910
|
5
|
+
2 => [0,0,2,0,2,4,2,0,8,4,2,4,2,4,8,0,2,10,2,16,8,4,2,
|
6
|
+
16,7,4,26,16,2,4,2,0,8,4,18,28,2,4,8,16,2,22,2,16,
|
7
|
+
17,4,2,16,30,24,8,16,2,28,43,32,8,4,2,16,2,4,8,0,
|
8
|
+
32,64,2,16,8,44,2,64,2,4,68,16,18,64,2,16,80,4,2,
|
9
|
+
64].map.with_index(1){|pm, b| [pm, b, b]},
|
10
|
+
|
11
|
+
# A002380
|
12
|
+
3 => [0,1,1,3,1,19,25,11,161,227,681,1019,3057,5075,
|
13
|
+
15225,29291,55105,34243,233801,439259,269201,
|
14
|
+
1856179,3471385,6219851,1882337,5647011,50495465,
|
15
|
+
17268667,186023729,21200275,63600825,1264544299,
|
16
|
+
3793632897,7085931395].map.with_index{|pm, b| [pm, b, 2**b]},
|
17
|
+
|
18
|
+
# A056969
|
19
|
+
10 => [0,0,1,0,0,4,3,0,1,0,10,4,10,2,10,0,10,10,10,0,13,
|
20
|
+
12,10,16,0,22,1,4,10,10,10,0,10,32,5,28,10,24,25,
|
21
|
+
0,10,22,10,12,10,8,10,16,31,0,31,16,10,28,10,16,
|
22
|
+
31,42,10,40,10,38,55,0,30,34,10,4,34,60,10,64,10,
|
23
|
+
26,25,44,54,40].map.with_index(1){|pm, b| [pm, b, b]} + [
|
24
|
+
0,0,1,0,0,4,4,0,1,0,1,4,3,4,10,0,4,10,9,0,4,12,
|
25
|
+
13,16,0,16,10,4,16,10,5,0,1,4,25,28,10,28,16,0,1,
|
26
|
+
4,31,12,10,36,27,16,11,0,4,16,28,10,45,32,28,16,
|
27
|
+
16,40,47,36,46,0,55,34,10,4,13,60,20,64,72,10,25,
|
28
|
+
28,67,16,67,0].map.with_index(1){|pm, b| [pm, 100, b]},
|
29
|
+
|
30
|
+
# A116609
|
31
|
+
13 => [0,1,1,1,3,1,6,1,1,9,2,1,0,1,7,1,13,1,13,1,13,15,
|
32
|
+
13,1,18,13,1,1,13,19,13,1,19,33,27,1,13,17,13,1,
|
33
|
+
13,1,13,5,28,31,13,1,48,49,4,13,13,1,32,1,31,53,
|
34
|
+
13,1,13,45,55,1,13,31,13,1,58,29,13,1,13,21,7,61,
|
35
|
+
62,13,13,1,1,5].map.with_index(1){|pm, b| [pm, b, b]}
|
36
|
+
}
|
37
|
+
|
38
|
+
@seq.each do |a, seq|
|
39
|
+
seq.each do |pm, b, m|
|
40
|
+
it "returns #{pm} for #{a}.power_mod(#{b}, #{m})" do
|
41
|
+
a.power_mod(b, m).should == pm
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
describe Integer, "#xgcd" do
|
2
|
+
|
3
|
+
# Data from Mathematica's ExtendedGCD[] function
|
4
|
+
# The keys are the arguments; the values, the results.
|
5
|
+
@seq = {
|
6
|
+
[56, 72] => [8, 4, -3],
|
7
|
+
[3, 7] => [1, -2, 1],
|
8
|
+
[10, 100] => [10, 1, 0],
|
9
|
+
[13, 11] => [1, -5, 6],
|
10
|
+
[79, 3] => [1, 1, -26],
|
11
|
+
[3, 65] => [1, 22, -1],
|
12
|
+
[-3, 65] => [1, -22, -1],
|
13
|
+
[3, -65] => [1, 22, 1],
|
14
|
+
[5, 0] => [5, 1, 0],
|
15
|
+
[73713, 3971] => [1, -1512, 28067],
|
16
|
+
[-234, 2] => [2, 0, 1],
|
17
|
+
[-876, 52] => [4, -6, -101],
|
18
|
+
}
|
19
|
+
|
20
|
+
@seq.each_pair do |input, output|
|
21
|
+
it "returns #{output} for #{input.first}.xgcd(#{input.last})" do
|
22
|
+
input.first.xgcd(input.last).should == output
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 184
|
8
|
+
- 0
|
9
|
+
version: 0.184.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Run Paint Run Run
|
@@ -9,19 +14,24 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-10-17 00:00:00 +01:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: gemcutter
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 1
|
31
|
+
- 0
|
23
32
|
version: 0.1.0
|
24
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
25
35
|
description:
|
26
36
|
email: runrun@runpaint.org
|
27
37
|
executables: []
|
@@ -92,7 +102,9 @@ files:
|
|
92
102
|
- lib/numb/idempotent.rb
|
93
103
|
- lib/numb/idoneal.rb
|
94
104
|
- lib/numb/in_sequence.rb
|
105
|
+
- lib/numb/inrt.rb
|
95
106
|
- lib/numb/integer_p.rb
|
107
|
+
- lib/numb/inv_mod.rb
|
96
108
|
- lib/numb/jacobsthal_lucas.rb
|
97
109
|
- lib/numb/kaprekar.rb
|
98
110
|
- lib/numb/keith.rb
|
@@ -121,6 +133,7 @@ files:
|
|
121
133
|
- lib/numb/nsw.rb
|
122
134
|
- lib/numb/oban.rb
|
123
135
|
- lib/numb/odious.rb
|
136
|
+
- lib/numb/ord.rb
|
124
137
|
- lib/numb/ordinal.rb
|
125
138
|
- lib/numb/palindrome.rb
|
126
139
|
- lib/numb/pandigital.rb
|
@@ -131,6 +144,7 @@ files:
|
|
131
144
|
- lib/numb/polydivisible.rb
|
132
145
|
- lib/numb/positive.rb
|
133
146
|
- lib/numb/poulet.rb
|
147
|
+
- lib/numb/power_mod.rb
|
134
148
|
- lib/numb/prime_power.rb
|
135
149
|
- lib/numb/primes.rb
|
136
150
|
- lib/numb/primitive_root.rb
|
@@ -171,6 +185,7 @@ files:
|
|
171
185
|
- lib/numb/words.rb
|
172
186
|
- lib/numb/zeisel.rb
|
173
187
|
- lib/numb/zerofree.rb
|
188
|
+
- spec/.rspec
|
174
189
|
- spec/numb/aban_spec.rb
|
175
190
|
- spec/numb/abundancy_spec.rb
|
176
191
|
- spec/numb/abundant_spec.rb
|
@@ -235,6 +250,7 @@ files:
|
|
235
250
|
- spec/numb/equidigital_spec.rb
|
236
251
|
- spec/numb/euclid_spec.rb
|
237
252
|
- spec/numb/evil_spec.rb
|
253
|
+
- spec/numb/exceptional_spec.rb
|
238
254
|
- spec/numb/extravagant_spec.rb
|
239
255
|
- spec/numb/factorial_spec.rb
|
240
256
|
- spec/numb/factorion_spec.rb
|
@@ -265,8 +281,10 @@ files:
|
|
265
281
|
- spec/numb/idoneal_spec.rb
|
266
282
|
- spec/numb/infinitary_divisors_spec.rb
|
267
283
|
- spec/numb/infinitary_perfect_spec.rb
|
284
|
+
- spec/numb/inrt_spec.rb
|
268
285
|
- spec/numb/integer_p_spec.rb
|
269
286
|
- spec/numb/interprime_spec.rb
|
287
|
+
- spec/numb/inv_mod_spec.rb
|
270
288
|
- spec/numb/isqrt_spec.rb
|
271
289
|
- spec/numb/jacobsthal_lucas_spec.rb
|
272
290
|
- spec/numb/k_perfect_spec.rb
|
@@ -310,6 +328,7 @@ files:
|
|
310
328
|
- spec/numb/octagonal_spec.rb
|
311
329
|
- spec/numb/octahedral_spec.rb
|
312
330
|
- spec/numb/odious_spec.rb
|
331
|
+
- spec/numb/ord_spec.rb
|
313
332
|
- spec/numb/ordinal_spec.rb
|
314
333
|
- spec/numb/ore_spec.rb
|
315
334
|
- spec/numb/palindrome_spec.rb
|
@@ -327,6 +346,7 @@ files:
|
|
327
346
|
- spec/numb/polydivisible_spec.rb
|
328
347
|
- spec/numb/positive_spec.rb
|
329
348
|
- spec/numb/poulet_spec.rb
|
349
|
+
- spec/numb/power_mod_spec.rb
|
330
350
|
- spec/numb/powerful_spec.rb
|
331
351
|
- spec/numb/practical_spec.rb
|
332
352
|
- spec/numb/prime_count_spec.rb
|
@@ -409,9 +429,9 @@ files:
|
|
409
429
|
- spec/numb/wieferich_prime_spec.rb
|
410
430
|
- spec/numb/woodall_spec.rb
|
411
431
|
- spec/numb/words_spec.rb
|
432
|
+
- spec/numb/xgcd_spec.rb
|
412
433
|
- spec/numb/zeisel_spec.rb
|
413
434
|
- spec/numb/zerofree_spec.rb
|
414
|
-
- spec/spec.opts
|
415
435
|
- spec/spec_helper.rb
|
416
436
|
has_rdoc: yard
|
417
437
|
homepage: http://github.com/runpaint/numb
|
@@ -423,263 +443,274 @@ rdoc_options: []
|
|
423
443
|
require_paths:
|
424
444
|
- lib
|
425
445
|
required_ruby_version: !ruby/object:Gem::Requirement
|
446
|
+
none: false
|
426
447
|
requirements:
|
427
448
|
- - ">="
|
428
449
|
- !ruby/object:Gem::Version
|
450
|
+
segments:
|
451
|
+
- 1
|
452
|
+
- 9
|
429
453
|
version: "1.9"
|
430
|
-
version:
|
431
454
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
455
|
+
none: false
|
432
456
|
requirements:
|
433
457
|
- - ">="
|
434
458
|
- !ruby/object:Gem::Version
|
459
|
+
segments:
|
460
|
+
- 0
|
435
461
|
version: "0"
|
436
|
-
version:
|
437
462
|
requirements: []
|
438
463
|
|
439
464
|
rubyforge_project:
|
440
|
-
rubygems_version: 1.3.
|
465
|
+
rubygems_version: 1.3.7
|
441
466
|
signing_key:
|
442
467
|
specification_version: 3
|
443
468
|
summary: Experiments in number theory with new predicate methods for Integer.
|
444
469
|
test_files:
|
445
|
-
- spec/
|
446
|
-
- spec/numb/
|
447
|
-
- spec/numb/
|
448
|
-
- spec/numb/
|
449
|
-
- spec/numb/
|
450
|
-
- spec/numb/prime_signature_spec.rb
|
451
|
-
- spec/numb/reciprocal_spec.rb
|
452
|
-
- spec/numb/mersenne_spec.rb
|
453
|
-
- spec/numb/unitary_divisor_spec.rb
|
454
|
-
- spec/numb/centered_square_spec.rb
|
455
|
-
- spec/numb/primitive_pseudoperfect_spec.rb
|
470
|
+
- spec/spec_helper.rb
|
471
|
+
- spec/numb/augmented_amicable_spec.rb
|
472
|
+
- spec/numb/trimorphic_spec.rb
|
473
|
+
- spec/numb/betrothed_spec.rb
|
474
|
+
- spec/numb/digital_sum_spec.rb
|
456
475
|
- spec/numb/polydivisible_spec.rb
|
457
|
-
- spec/numb/mangoldt_spec.rb
|
458
|
-
- spec/numb/choose_spec.rb
|
459
|
-
- spec/numb/n_step_fibonacci_spec.rb
|
460
|
-
- spec/numb/sum_of_infinitary_divisors_spec.rb
|
461
|
-
- spec/numb/strictly_non_palindromic_spec.rb
|
462
|
-
- spec/numb/gnomonic_spec.rb
|
463
|
-
- spec/numb/cyclic_spec.rb
|
464
|
-
- spec/numb/iban_spec.rb
|
465
|
-
- spec/numb/equidigital_spec.rb
|
466
|
-
- spec/numb/primorial_spec.rb
|
467
|
-
- spec/numb/prime_power_spec.rb
|
468
|
-
- spec/numb/superabundant_spec.rb
|
469
|
-
- spec/numb/modulo_order_spec.rb
|
470
|
-
- spec/numb/sociable_spec.rb
|
471
|
-
- spec/numb/unitary_perfect_spec.rb
|
472
|
-
- "spec/numb/schr\xC3\xB6der_spec.rb"
|
473
|
-
- spec/numb/nivenmorphic_spec.rb
|
474
|
-
- spec/numb/dudeney_spec.rb
|
475
|
-
- spec/numb/centered_triangular_spec.rb
|
476
476
|
- spec/numb/square_free_spec.rb
|
477
|
-
- spec/numb/
|
478
|
-
- spec/numb/
|
479
|
-
- spec/numb/
|
477
|
+
- spec/numb/woodall_spec.rb
|
478
|
+
- spec/numb/unitary_sociable_spec.rb
|
479
|
+
- spec/numb/refactorable_spec.rb
|
480
|
+
- spec/numb/maris_mcgwire_sosa_pair_spec.rb
|
481
|
+
- spec/numb/zeisel_spec.rb
|
482
|
+
- spec/numb/q_spec.rb
|
483
|
+
- spec/numb/centered_cube_spec.rb
|
484
|
+
- spec/numb/blum_spec.rb
|
480
485
|
- spec/numb/superperfect_spec.rb
|
481
|
-
- spec/numb/
|
482
|
-
- spec/numb/
|
483
|
-
- spec/numb/
|
486
|
+
- spec/numb/power_mod_spec.rb
|
487
|
+
- spec/numb/proth_spec.rb
|
488
|
+
- spec/numb/emrip_spec.rb
|
489
|
+
- spec/numb/minimal_spec.rb
|
490
|
+
- spec/numb/weird_spec.rb
|
491
|
+
- spec/numb/practical_spec.rb
|
492
|
+
- spec/numb/ore_spec.rb
|
493
|
+
- spec/numb/base_spec.rb
|
494
|
+
- spec/numb/achilles_spec.rb
|
495
|
+
- spec/numb/uban_spec.rb
|
496
|
+
- spec/numb/lah_spec.rb
|
497
|
+
- spec/numb/delannoy_spec.rb
|
498
|
+
- spec/numb/beastly_spec.rb
|
499
|
+
- spec/numb/smarandache_spec.rb
|
500
|
+
- spec/numb/narcissistic_spec.rb
|
501
|
+
- spec/numb/totient_spec.rb
|
502
|
+
- spec/numb/core_spec.rb
|
503
|
+
- spec/numb/star_spec.rb
|
504
|
+
- spec/numb/inv_mod_spec.rb
|
484
505
|
- spec/numb/ruler_spec.rb
|
485
|
-
- spec/numb/square_spec.rb
|
486
|
-
- spec/numb/quarticfree_spec.rb
|
487
|
-
- spec/numb/untouchable_spec.rb
|
488
|
-
- spec/numb/ordinal_spec.rb
|
489
|
-
- spec/numb/perfect_spec.rb
|
490
|
-
- spec/numb/perfect_power_spec.rb
|
491
|
-
- spec/numb/factorial_spec.rb
|
492
|
-
- spec/numb/centered_cube_spec.rb
|
493
|
-
- "spec/numb/m\xC3\xA9nage_spec.rb"
|
494
506
|
- spec/numb/carmichael_spec.rb
|
495
|
-
- spec/numb/
|
496
|
-
- spec/numb/abundancy_spec.rb
|
497
|
-
- spec/numb/giuga_spec.rb
|
498
|
-
- spec/numb/polite_spec.rb
|
499
|
-
- spec/numb/unitary_amicable_spec.rb
|
500
|
-
- spec/numb/squared_triangular_spec.rb
|
501
|
-
- spec/numb/persistent_spec.rb
|
502
|
-
- spec/numb/cullen_spec.rb
|
503
|
-
- spec/numb/palindrome_spec.rb
|
504
|
-
- spec/numb/smarandache_spec.rb
|
505
|
-
- spec/numb/zerofree_spec.rb
|
506
|
-
- spec/numb/eban_spec.rb
|
507
|
-
- spec/numb/automorphic_spec.rb
|
508
|
-
- spec/numb/fermat_spec.rb
|
509
|
-
- spec/numb/stirling_spec.rb
|
510
|
-
- spec/numb/minimal_spec.rb
|
511
|
-
- spec/numb/jacobsthal_lucas_spec.rb
|
507
|
+
- spec/numb/cube_spec.rb
|
512
508
|
- spec/numb/aban_spec.rb
|
509
|
+
- spec/numb/semiprime_spec.rb
|
510
|
+
- spec/numb/fermat_spec.rb
|
511
|
+
- spec/numb/abundant_spec.rb
|
512
|
+
- spec/numb/hoax_spec.rb
|
513
|
+
- spec/numb/goldbach_spec.rb
|
514
|
+
- spec/numb/heptagonal_spec.rb
|
515
|
+
- spec/numb/harshad_spec.rb
|
516
|
+
- spec/numb/aspiring_spec.rb
|
517
|
+
- spec/numb/evil_spec.rb
|
518
|
+
- spec/numb/cyclic_spec.rb
|
519
|
+
- spec/numb/unusual_spec.rb
|
520
|
+
- spec/numb/square_part_spec.rb
|
521
|
+
- spec/numb/demlo_spec.rb
|
522
|
+
- spec/numb/sum_of_divisors_spec.rb
|
523
|
+
- spec/numb/mersenne_spec.rb
|
524
|
+
- spec/numb/polite_spec.rb
|
525
|
+
- spec/numb/iban_spec.rb
|
513
526
|
- spec/numb/hyperperfect_spec.rb
|
514
|
-
- spec/numb/
|
515
|
-
- spec/numb/
|
516
|
-
- spec/numb/
|
517
|
-
- spec/numb/
|
527
|
+
- spec/numb/cubic_residue_spec.rb
|
528
|
+
- spec/numb/palindrome_spec.rb
|
529
|
+
- spec/numb/carol_spec.rb
|
530
|
+
- spec/numb/prime_count_spec.rb
|
531
|
+
- spec/numb/reverse_spec.rb
|
532
|
+
- spec/numb/bernoulli_spec.rb
|
533
|
+
- spec/numb/square_spec.rb
|
534
|
+
- spec/numb/leyland_spec.rb
|
535
|
+
- spec/numb/ramanujan_tau_spec.rb
|
536
|
+
- spec/numb/mersenne_prime_spec.rb
|
537
|
+
- spec/numb/self_spec.rb
|
538
|
+
- spec/numb/poulet_spec.rb
|
539
|
+
- spec/numb/repunit_spec.rb
|
518
540
|
- spec/numb/primitive_roots_spec.rb
|
519
|
-
- spec/numb/
|
520
|
-
- spec/numb/
|
521
|
-
- spec/numb/
|
522
|
-
- spec/numb/
|
523
|
-
- spec/numb/
|
524
|
-
- spec/numb/
|
525
|
-
- spec/numb/centered_hexagonal_spec.rb
|
526
|
-
- spec/numb/centered_n_gonal_spec.rb
|
541
|
+
- spec/numb/self_descriptive_spec.rb
|
542
|
+
- spec/numb/twin_prime_spec.rb
|
543
|
+
- spec/numb/fibonacci_spec.rb
|
544
|
+
- spec/numb/jacobsthal_lucas_spec.rb
|
545
|
+
- spec/numb/unitary_perfect_spec.rb
|
546
|
+
- spec/numb/choose_spec.rb
|
527
547
|
- spec/numb/highly_abundant_spec.rb
|
548
|
+
- spec/numb/idoneal_spec.rb
|
549
|
+
- spec/numb/unitary_divisor_spec.rb
|
550
|
+
- spec/numb/centered_n_gonal_spec.rb
|
551
|
+
- spec/numb/stirling_spec.rb
|
552
|
+
- spec/numb/untouchable_spec.rb
|
553
|
+
- spec/numb/cullen_spec.rb
|
554
|
+
- spec/numb/d_spec.rb
|
555
|
+
- spec/numb/centered_pentagonal_spec.rb
|
556
|
+
- spec/numb/politeness_spec.rb
|
557
|
+
- spec/numb/modulo_order_spec.rb
|
558
|
+
- spec/numb/quarticfree_spec.rb
|
559
|
+
- spec/numb/strictly_non_palindromic_spec.rb
|
560
|
+
- spec/numb/octagonal_spec.rb
|
561
|
+
- spec/numb/takeuchi_spec.rb
|
562
|
+
- spec/numb/amenable_spec.rb
|
563
|
+
- spec/numb/sum_of_unitary_divisors_spec.rb
|
528
564
|
- spec/numb/e_perfect_spec.rb
|
529
|
-
- spec/numb/
|
530
|
-
- spec/numb/
|
531
|
-
- spec/numb/
|
532
|
-
- spec/numb/
|
533
|
-
- spec/numb/
|
534
|
-
- spec/numb/
|
535
|
-
- spec/numb/
|
536
|
-
- spec/numb/
|
537
|
-
- spec/numb/
|
538
|
-
- spec/numb/
|
539
|
-
- spec/numb/
|
540
|
-
- spec/numb/
|
541
|
-
- spec/numb/
|
565
|
+
- spec/numb/positive_spec.rb
|
566
|
+
- spec/numb/undulating_spec.rb
|
567
|
+
- spec/numb/friendly_spec.rb
|
568
|
+
- spec/numb/rhonda_spec.rb
|
569
|
+
- spec/numb/prime_signature_spec.rb
|
570
|
+
- spec/numb/oban_spec.rb
|
571
|
+
- spec/numb/super_d_spec.rb
|
572
|
+
- spec/numb/economical_spec.rb
|
573
|
+
- spec/numb/kynea_spec.rb
|
574
|
+
- spec/numb/full_reptend_prime_spec.rb
|
575
|
+
- spec/numb/semi_perfect_spec.rb
|
576
|
+
- spec/numb/binomial_spec.rb
|
577
|
+
- spec/numb/pyramidal_spec.rb
|
578
|
+
- spec/numb/odious_spec.rb
|
579
|
+
- spec/numb/sophie_germain_prime_spec.rb
|
542
580
|
- spec/numb/doubly_even_spec.rb
|
543
|
-
- spec/numb/
|
581
|
+
- spec/numb/k_perfect_spec.rb
|
582
|
+
- spec/numb/pandigital_spec.rb
|
583
|
+
- spec/numb/frugal_spec.rb
|
584
|
+
- spec/numb/triangular_spec.rb
|
585
|
+
- spec/numb/octahedral_spec.rb
|
586
|
+
- spec/numb/super_poulet_spec.rb
|
587
|
+
- spec/numb/unitary_amicable_spec.rb
|
588
|
+
- spec/numb/myriagonal_spec.rb
|
589
|
+
- spec/numb/amicable_spec.rb
|
544
590
|
- spec/numb/bell_spec.rb
|
545
|
-
- spec/numb/
|
591
|
+
- spec/numb/super_catalan_spec.rb
|
592
|
+
- spec/numb/motzkin_spec.rb
|
593
|
+
- spec/numb/mobius_spec.rb
|
594
|
+
- spec/numb/chen_prime_spec.rb
|
595
|
+
- spec/numb/pentatope_spec.rb
|
596
|
+
- spec/numb/centered_triangular_spec.rb
|
597
|
+
- spec/numb/liouville_spec.rb
|
598
|
+
- spec/numb/lychrel_spec.rb
|
599
|
+
- spec/numb/stella_octangula_spec.rb
|
600
|
+
- spec/numb/lucas_spec.rb
|
601
|
+
- spec/numb/persistent_spec.rb
|
602
|
+
- spec/numb/sum_of_infinitary_divisors_spec.rb
|
603
|
+
- spec/numb/integer_p_spec.rb
|
604
|
+
- spec/numb/biquadratic_spec.rb
|
605
|
+
- spec/numb/perfect_power_spec.rb
|
606
|
+
- spec/numb/multiamicable_spec.rb
|
607
|
+
- spec/numb/automorphic_spec.rb
|
608
|
+
- spec/numb/safe_prime_spec.rb
|
609
|
+
- spec/numb/brilliant_spec.rb
|
610
|
+
- spec/numb/breeder_spec.rb
|
611
|
+
- spec/numb/hilbert_spec.rb
|
612
|
+
- spec/numb/brown_spec.rb
|
613
|
+
- spec/numb/words_spec.rb
|
614
|
+
- spec/numb/extravagant_spec.rb
|
546
615
|
- spec/numb/sublime_spec.rb
|
547
|
-
- spec/numb/
|
616
|
+
- spec/numb/leonardo_spec.rb
|
617
|
+
- spec/numb/lucas_carmichael_spec.rb
|
548
618
|
- spec/numb/subfactorial_spec.rb
|
549
|
-
- spec/numb/
|
550
|
-
- spec/numb/
|
551
|
-
- spec/numb/
|
552
|
-
- spec/numb/
|
553
|
-
- spec/numb/
|
619
|
+
- spec/numb/parasitic_spec.rb
|
620
|
+
- spec/numb/giuga_spec.rb
|
621
|
+
- spec/numb/mertens_spec.rb
|
622
|
+
- spec/numb/lucas2_spec.rb
|
623
|
+
- spec/numb/highly_composite_spec.rb
|
624
|
+
- spec/numb/quadratic_residue_spec.rb
|
625
|
+
- spec/numb/unhappy_spec.rb
|
626
|
+
- spec/numb/e_divisors_spec.rb
|
627
|
+
- spec/numb/franel_spec.rb
|
628
|
+
- spec/numb/nsw_spec.rb
|
554
629
|
- spec/numb/knuth_spec.rb
|
630
|
+
- spec/numb/first_with_n_divisors_spec.rb
|
631
|
+
- spec/numb/isqrt_spec.rb
|
632
|
+
- spec/numb/inrt_spec.rb
|
633
|
+
- spec/numb/nexus_spec.rb
|
634
|
+
- spec/numb/wieferich_prime_spec.rb
|
635
|
+
- spec/numb/idempotent_spec.rb
|
555
636
|
- spec/numb/entringer_spec.rb
|
556
|
-
- spec/numb/
|
557
|
-
- spec/numb/
|
558
|
-
- spec/numb/
|
559
|
-
- spec/numb/
|
560
|
-
- spec/numb/tetrahedral_spec.rb
|
561
|
-
- spec/numb/dodecagonal_spec.rb
|
562
|
-
- spec/numb/dihedral_prime_spec.rb
|
563
|
-
- spec/numb/breeder_spec.rb
|
564
|
-
- spec/numb/sphenic_spec.rb
|
565
|
-
- spec/numb/reverse_spec.rb
|
566
|
-
- spec/numb/idoneal_spec.rb
|
567
|
-
- spec/numb/sum_of_unitary_divisors_spec.rb
|
637
|
+
- spec/numb/divides_spec.rb
|
638
|
+
- spec/numb/rough_spec.rb
|
639
|
+
- spec/numb/singly_even_spec.rb
|
640
|
+
- spec/numb/prime_power_spec.rb
|
568
641
|
- spec/numb/square_triangular_spec.rb
|
569
|
-
- spec/numb/
|
570
|
-
- spec/numb/
|
571
|
-
- spec/numb/
|
572
|
-
- spec/numb/
|
573
|
-
- spec/numb/
|
574
|
-
- spec/numb/
|
642
|
+
- spec/numb/coprime_spec.rb
|
643
|
+
- spec/numb/perfect_spec.rb
|
644
|
+
- spec/numb/almost_prime_spec.rb
|
645
|
+
- spec/numb/number_of_distinct_prime_factors_spec.rb
|
646
|
+
- spec/numb/achain_spec.rb
|
647
|
+
- spec/numb/primitive_root_spec.rb
|
648
|
+
- spec/numb/primitive_pseudoperfect_spec.rb
|
575
649
|
- spec/numb/composite_spec.rb
|
576
|
-
- spec/numb/practical_spec.rb
|
577
|
-
- spec/numb/words_spec.rb
|
578
|
-
- spec/numb/sophie_germain_prime_spec.rb
|
579
|
-
- spec/numb/parasitic_spec.rb
|
580
|
-
- spec/numb/friendly_spec.rb
|
581
650
|
- spec/numb/number_of_prime_factors_spec.rb
|
582
|
-
- spec/numb/
|
583
|
-
- spec/numb/
|
584
|
-
- spec/numb/
|
585
|
-
- spec/numb/
|
586
|
-
- spec/numb/
|
587
|
-
- spec/numb/
|
588
|
-
- spec/numb/
|
589
|
-
- spec/numb/
|
590
|
-
- spec/numb/
|
591
|
-
- spec/numb/
|
592
|
-
- spec/numb/
|
593
|
-
- spec/numb/
|
651
|
+
- spec/numb/smooth_spec.rb
|
652
|
+
- spec/numb/reciprocal_spec.rb
|
653
|
+
- spec/numb/hamming_spec.rb
|
654
|
+
- spec/numb/eban_spec.rb
|
655
|
+
- spec/numb/stirling2_spec.rb
|
656
|
+
- spec/numb/interprime_spec.rb
|
657
|
+
- spec/numb/factorial_spec.rb
|
658
|
+
- spec/numb/superabundant_spec.rb
|
659
|
+
- spec/numb/sociable_spec.rb
|
660
|
+
- spec/numb/dudeney_spec.rb
|
661
|
+
- spec/numb/pell_lucas_spec.rb
|
662
|
+
- spec/numb/mangoldt_spec.rb
|
663
|
+
- spec/numb/near_square_spec.rb
|
664
|
+
- spec/numb/primorial_spec.rb
|
665
|
+
- spec/numb/dodecagonal_spec.rb
|
666
|
+
- spec/numb/fermat_pseudoprime_spec.rb
|
667
|
+
- spec/numb/vampire_spec.rb
|
594
668
|
- spec/numb/almost_perfect_spec.rb
|
595
|
-
- spec/numb/amicable_spec.rb
|
596
|
-
- spec/numb/brilliant_spec.rb
|
597
|
-
- spec/numb/amenable_spec.rb
|
598
|
-
- spec/numb/happy_spec.rb
|
599
|
-
- spec/numb/twin_prime_spec.rb
|
600
|
-
- spec/numb/hexagonal_spec.rb
|
601
|
-
- spec/numb/nsw_spec.rb
|
602
669
|
- spec/numb/primitive_abundant_spec.rb
|
603
|
-
- spec/numb/
|
604
|
-
- spec/numb/lucas2_spec.rb
|
605
|
-
- spec/numb/genocchi_spec.rb
|
606
|
-
- spec/numb/wieferich_prime_spec.rb
|
607
|
-
- spec/numb/cubic_residue_spec.rb
|
608
|
-
- spec/numb/fibonacci_spec.rb
|
609
|
-
- spec/numb/triangular_spec.rb
|
610
|
-
- spec/numb/integer_p_spec.rb
|
670
|
+
- spec/numb/nth_prime_spec.rb
|
611
671
|
- spec/numb/infinitary_perfect_spec.rb
|
612
|
-
- spec/numb/
|
613
|
-
- spec/numb/
|
614
|
-
- spec/numb/
|
615
|
-
- spec/numb/
|
616
|
-
- spec/numb/
|
672
|
+
- spec/numb/happy_spec.rb
|
673
|
+
- spec/numb/decagonal_spec.rb
|
674
|
+
- spec/numb/nivenmorphic_spec.rb
|
675
|
+
- spec/numb/genocchi_spec.rb
|
676
|
+
- spec/numb/segmented_spec.rb
|
677
|
+
- spec/numb/squared_triangular_spec.rb
|
678
|
+
- spec/numb/centered_hexagonal_spec.rb
|
679
|
+
- spec/numb/tetrahedral_spec.rb
|
680
|
+
- spec/numb/gnomonic_spec.rb
|
681
|
+
- spec/numb/hexagonal_spec.rb
|
682
|
+
- spec/numb/pronic_spec.rb
|
683
|
+
- spec/numb/ord_spec.rb
|
684
|
+
- spec/numb/dihedral_prime_spec.rb
|
685
|
+
- spec/numb/exceptional_spec.rb
|
686
|
+
- spec/numb/congruum_spec.rb
|
687
|
+
- spec/numb/sum_of_squares_spec.rb
|
617
688
|
- spec/numb/smarandache_wellin_spec.rb
|
618
|
-
- spec/numb/
|
619
|
-
- spec/numb/
|
620
|
-
- spec/numb/
|
621
|
-
- spec/numb/lucas_spec.rb
|
622
|
-
- spec/numb/k_perfect_spec.rb
|
623
|
-
- spec/numb/trimorphic_spec.rb
|
624
|
-
- spec/numb/evil_spec.rb
|
625
|
-
- spec/numb/harshad_spec.rb
|
626
|
-
- spec/numb/star_spec.rb
|
627
|
-
- spec/numb/cube_spec.rb
|
628
|
-
- spec/numb/ore_spec.rb
|
629
|
-
- spec/numb/achain_spec.rb
|
630
|
-
- spec/numb/delannoy_spec.rb
|
631
|
-
- spec/numb/carol_spec.rb
|
632
|
-
- spec/numb/powerful_spec.rb
|
633
|
-
- spec/numb/prime_count_spec.rb
|
634
|
-
- spec/numb/q_spec.rb
|
635
|
-
- spec/numb/primitive_root_spec.rb
|
636
|
-
- spec/numb/weird_spec.rb
|
637
|
-
- spec/numb/interprime_spec.rb
|
638
|
-
- spec/numb/number_of_distinct_prime_factors_spec.rb
|
639
|
-
- spec/numb/mertens_spec.rb
|
689
|
+
- "spec/numb/st\xC3\xB8rmer_spec.rb"
|
690
|
+
- spec/numb/kaprekar_spec.rb
|
691
|
+
- "spec/numb/schr\xC3\xB6der_spec.rb"
|
640
692
|
- spec/numb/catalan_spec.rb
|
693
|
+
- spec/numb/factorion_spec.rb
|
641
694
|
- spec/numb/balanced_prime_spec.rb
|
642
|
-
- spec/numb/
|
643
|
-
- spec/numb/
|
644
|
-
- spec/numb/
|
695
|
+
- spec/numb/abundancy_spec.rb
|
696
|
+
- spec/numb/smith_spec.rb
|
697
|
+
- "spec/numb/m\xC3\xA9nage_spec.rb"
|
698
|
+
- spec/numb/zerofree_spec.rb
|
699
|
+
- spec/numb/n_step_fibonacci_spec.rb
|
700
|
+
- spec/numb/euclid_spec.rb
|
701
|
+
- spec/numb/noncototient_spec.rb
|
645
702
|
- spec/numb/perrin_spec.rb
|
646
|
-
- spec/numb/
|
647
|
-
- spec/numb/
|
648
|
-
- spec/numb/multiamicable_spec.rb
|
649
|
-
- spec/numb/super_poulet_spec.rb
|
703
|
+
- spec/numb/centered_square_spec.rb
|
704
|
+
- spec/numb/sphenic_spec.rb
|
650
705
|
- spec/numb/sum_of_e_divisors_spec.rb
|
651
|
-
- spec/numb/pyramidal_spec.rb
|
652
|
-
- spec/numb/ramanujan_tau_spec.rb
|
653
|
-
- spec/numb/super_d_spec.rb
|
654
|
-
- spec/numb/factorion_spec.rb
|
655
|
-
- spec/numb/lah_spec.rb
|
656
|
-
- spec/numb/undulating_spec.rb
|
657
|
-
- spec/numb/extravagant_spec.rb
|
658
|
-
- spec/numb/sum_of_divisors_spec.rb
|
659
|
-
- spec/numb/lychrel_spec.rb
|
660
|
-
- spec/numb/self_descriptive_spec.rb
|
661
|
-
- spec/numb/decagonal_spec.rb
|
662
|
-
- spec/numb/e_divisors_spec.rb
|
663
706
|
- spec/numb/apocalyptic_spec.rb
|
664
|
-
- spec/numb/bernoulli_spec.rb
|
665
|
-
- spec/numb/kaprekar_spec.rb
|
666
|
-
- spec/numb/isqrt_spec.rb
|
667
|
-
- spec/numb/hilbert_spec.rb
|
668
|
-
- "spec/numb/st\xC3\xB8rmer_spec.rb"
|
669
|
-
- spec/numb/keith_spec.rb
|
670
|
-
- spec/numb/narcissistic_spec.rb
|
671
|
-
- spec/numb/myriagonal_spec.rb
|
672
|
-
- spec/numb/oban_spec.rb
|
673
|
-
- spec/numb/achilles_spec.rb
|
674
|
-
- spec/numb/coprime_spec.rb
|
675
707
|
- spec/numb/infinitary_divisors_spec.rb
|
676
|
-
- spec/numb/
|
677
|
-
- spec/numb/
|
678
|
-
- spec/numb/
|
679
|
-
- spec/numb/
|
680
|
-
- spec/numb/
|
681
|
-
- spec/numb/
|
682
|
-
- spec/numb/
|
683
|
-
- spec/numb/
|
684
|
-
- spec/numb/
|
685
|
-
- spec/spec_helper.rb
|
708
|
+
- spec/numb/nonhypotenuse_spec.rb
|
709
|
+
- spec/numb/deficient_spec.rb
|
710
|
+
- spec/numb/knodel_spec.rb
|
711
|
+
- spec/numb/powerful_spec.rb
|
712
|
+
- spec/numb/ordinal_spec.rb
|
713
|
+
- spec/numb/equidigital_spec.rb
|
714
|
+
- spec/numb/keith_spec.rb
|
715
|
+
- spec/numb/xgcd_spec.rb
|
716
|
+
- spec/numb/pentagonal_spec.rb
|
/data/spec/{spec.opts → .rspec}
RENAMED
File without changes
|