numb 0.152.0 → 0.170.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. data/VERSION +1 -1
  2. data/lib/numb/bell.rb +9 -12
  3. data/lib/numb/bernoulli.rb +7 -8
  4. data/lib/numb/catalan.rb +1 -5
  5. data/lib/numb/divisors/abundant.rb +58 -0
  6. data/lib/numb/divisors/aliquot.rb +31 -0
  7. data/lib/numb/divisors/amicable.rb +38 -0
  8. data/lib/numb/divisors/perfect.rb +73 -0
  9. data/lib/numb/divisors.rb +389 -0
  10. data/lib/numb/entringer.rb +2 -0
  11. data/lib/numb/figurate.rb +138 -0
  12. data/lib/numb/in_sequence.rb +11 -0
  13. data/lib/numb/jacobsthal_lucas.rb +5 -6
  14. data/lib/numb/knuth.rb +1 -4
  15. data/lib/numb/lucas.rb +5 -5
  16. data/lib/numb/lucas2.rb +11 -0
  17. data/lib/numb/lychrel.rb +0 -4
  18. data/lib/numb/palindrome.rb +8 -0
  19. data/lib/numb/pell_lucas.rb +9 -0
  20. data/lib/numb/primes.rb +164 -0
  21. data/lib/numb/pronic.rb +1 -0
  22. data/lib/numb/q.rb +13 -0
  23. data/lib/numb/schr/303/266der.rb +20 -0
  24. data/lib/numb/segmented.rb +29 -0
  25. data/lib/numb/stirling.rb +9 -0
  26. data/lib/numb/stirling2.rb +9 -0
  27. data/lib/numb/strictly_non_palindromic.rb +1 -5
  28. data/lib/numb/super_catalan.rb +17 -0
  29. data/lib/numb/super_d.rb +6 -0
  30. data/lib/numb/takeuchi.rb +18 -0
  31. data/lib/numb/unhappy.rb +2 -0
  32. data/lib/numb.rb +1 -53
  33. data/spec/numb/first_with_n_divisors_spec.rb +15 -0
  34. data/spec/numb/highly_composite_spec.rb +1 -1
  35. data/spec/numb/jacobsthal_lucas_spec.rb +19 -11
  36. data/spec/numb/lucas2_spec.rb +30 -0
  37. data/spec/numb/lucas_spec.rb +17 -9
  38. data/spec/numb/minimal_spec.rb +1 -1
  39. data/spec/numb/near_square_spec.rb +54 -0
  40. data/spec/numb/octahedral_spec.rb +29 -0
  41. data/spec/numb/palindrome_spec.rb +43 -0
  42. data/spec/numb/pell_lucas_spec.rb +28 -0
  43. data/spec/numb/pentatope_spec.rb +15 -0
  44. data/spec/numb/primitive_abundant_spec.rb +21 -0
  45. data/spec/numb/pyramidal_spec.rb +42 -0
  46. data/spec/numb/q_spec.rb +31 -0
  47. data/spec/numb/schr/303/266der_spec.rb +28 -0
  48. data/spec/numb/segmented_spec.rb +29 -0
  49. data/spec/numb/square_part_spec.rb +15 -0
  50. data/spec/numb/star_spec.rb +29 -0
  51. data/spec/numb/stella_octangula_spec.rb +29 -0
  52. data/spec/numb/stirling2_spec.rb +23 -0
  53. data/spec/numb/stirling_spec.rb +23 -0
  54. data/spec/numb/super_catalan_spec.rb +29 -0
  55. data/spec/numb/super_d_spec.rb +68 -0
  56. data/spec/numb/takeuchi_spec.rb +28 -0
  57. data/spec/numb/tetrahedral_spec.rb +15 -0
  58. metadata +63 -100
  59. data/lib/numb/abundancy.rb +0 -8
  60. data/lib/numb/abundant.rb +0 -20
  61. data/lib/numb/achilles.rb +0 -15
  62. data/lib/numb/aliquot_sequence.rb +0 -13
  63. data/lib/numb/almost_perfect.rb +0 -8
  64. data/lib/numb/almost_prime.rb +0 -6
  65. data/lib/numb/amicable.rb +0 -6
  66. data/lib/numb/aspiring.rb +0 -8
  67. data/lib/numb/augmented_amicable.rb +0 -7
  68. data/lib/numb/balanced_prime.rb +0 -10
  69. data/lib/numb/betrothed.rb +0 -8
  70. data/lib/numb/breeder.rb +0 -9
  71. data/lib/numb/brilliant.rb +0 -7
  72. data/lib/numb/centered_cube.rb +0 -7
  73. data/lib/numb/centered_hexagonal.rb +0 -6
  74. data/lib/numb/centered_n_gonal.rb +0 -9
  75. data/lib/numb/centered_pentagonal.rb +0 -6
  76. data/lib/numb/centered_square.rb +0 -5
  77. data/lib/numb/centered_triangular.rb +0 -5
  78. data/lib/numb/composite.rb +0 -5
  79. data/lib/numb/coprime.rb +0 -9
  80. data/lib/numb/cube.rb +0 -5
  81. data/lib/numb/d.rb +0 -6
  82. data/lib/numb/decagonal.rb +0 -5
  83. data/lib/numb/deficient.rb +0 -19
  84. data/lib/numb/dihedral_prime.rb +0 -26
  85. data/lib/numb/dodecagonal.rb +0 -5
  86. data/lib/numb/e_divisors.rb +0 -10
  87. data/lib/numb/e_perfect.rb +0 -7
  88. data/lib/numb/economical.rb +0 -16
  89. data/lib/numb/emrip.rb +0 -15
  90. data/lib/numb/equidigital.rb +0 -18
  91. data/lib/numb/extravagant.rb +0 -18
  92. data/lib/numb/fermat_pseudoprime.rb +0 -9
  93. data/lib/numb/friendly.rb +0 -9
  94. data/lib/numb/full_reptend_prime.rb +0 -5
  95. data/lib/numb/giuga.rb +0 -7
  96. data/lib/numb/harshad.rb +0 -9
  97. data/lib/numb/heptagonal.rb +0 -5
  98. data/lib/numb/hexagonal.rb +0 -6
  99. data/lib/numb/highly_abundant.rb +0 -7
  100. data/lib/numb/highly_composite.rb +0 -12
  101. data/lib/numb/hoax.rb +0 -7
  102. data/lib/numb/hyperperfect.rb +0 -7
  103. data/lib/numb/impolite.rb +0 -6
  104. data/lib/numb/infinitary_divisors.rb +0 -15
  105. data/lib/numb/infinitary_perfect.rb +0 -6
  106. data/lib/numb/interprime.rb +0 -6
  107. data/lib/numb/k_perfect.rb +0 -8
  108. data/lib/numb/mersenne_prime.rb +0 -5
  109. data/lib/numb/minimal.rb +0 -8
  110. data/lib/numb/multiamicable.rb +0 -7
  111. data/lib/numb/myriagonal.rb +0 -5
  112. data/lib/numb/n_gonal.rb +0 -7
  113. data/lib/numb/next_prev_prime.rb +0 -13
  114. data/lib/numb/nth_prime.rb +0 -17
  115. data/lib/numb/number_of_divisors.rb +0 -22
  116. data/lib/numb/octagonal.rb +0 -5
  117. data/lib/numb/ore.rb +0 -8
  118. data/lib/numb/pentagonal.rb +0 -5
  119. data/lib/numb/perfect.rb +0 -8
  120. data/lib/numb/perfect_power.rb +0 -9
  121. data/lib/numb/polite.rb +0 -7
  122. data/lib/numb/powerful.rb +0 -10
  123. data/lib/numb/practical.rb +0 -26
  124. data/lib/numb/prime_count.rb +0 -16
  125. data/lib/numb/prime_signature.rb +0 -5
  126. data/lib/numb/primitive_pseudoperfect.rb +0 -5
  127. data/lib/numb/rhonda.rb +0 -6
  128. data/lib/numb/rough.rb +0 -5
  129. data/lib/numb/safe_prime.rb +0 -5
  130. data/lib/numb/semiperfect.rb +0 -20
  131. data/lib/numb/semiprime.rb +0 -6
  132. data/lib/numb/smith.rb +0 -7
  133. data/lib/numb/smooth.rb +0 -5
  134. data/lib/numb/sociable.rb +0 -6
  135. data/lib/numb/sophie_germain_prime.rb +0 -5
  136. data/lib/numb/square.rb +0 -7
  137. data/lib/numb/square_free.rb +0 -6
  138. data/lib/numb/square_triangular.rb +0 -5
  139. data/lib/numb/squared_triangular.rb +0 -5
  140. data/lib/numb/sublime.rb +0 -6
  141. data/lib/numb/sum_of_e_divisors.rb +0 -10
  142. data/lib/numb/sum_of_infinitary_divisors.rb +0 -9
  143. data/lib/numb/sum_of_unitary_divisors.rb +0 -5
  144. data/lib/numb/super_poulet.rb +0 -5
  145. data/lib/numb/superabundant.rb +0 -18
  146. data/lib/numb/superperfect.rb +0 -6
  147. data/lib/numb/triangular.rb +0 -6
  148. data/lib/numb/twin_prime.rb +0 -5
  149. data/lib/numb/unitary_amicable.rb +0 -7
  150. data/lib/numb/unitary_divisor.rb +0 -5
  151. data/lib/numb/unitary_perfect.rb +0 -7
  152. data/lib/numb/unitary_sociable.rb +0 -7
  153. data/lib/numb/untouchable.rb +0 -14
  154. data/lib/numb/unusual.rb +0 -5
  155. data/lib/numb/weird.rb +0 -8
  156. data/lib/numb/wieferich.rb +0 -6
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ # A000651
3
+ TAKEUCHI = [0, 1, 4, 14, 53, 223, 1034, 5221, 28437, 165859, 1029803, 6772850,
4
+ 46983238, 342509396, 2615606677, 20865444825, 173446634597,
5
+ 1499111445237, 13445550920288, 124919896067530,
6
+ 1200320663197275, 11910845573790488]
7
+
8
+ describe Integer, "#takeuchi" do
9
+ TAKEUCHI.each_with_index do |t, n|
10
+ it "returns #{t} as the #{n}#{n.ordinal} Takeuchi number" do
11
+ n.takeuchi.should == t
12
+ end
13
+ end
14
+ end
15
+
16
+ describe Integer, "#takeuchi?" do
17
+ TAKEUCHI.each do |n|
18
+ it "returns true for Takeuchi number #{n}" do
19
+ n.should be_takeuchi
20
+ end
21
+ end
22
+
23
+ TAKEUCHI.to_seq.invert.sample(100).each do |n|
24
+ it "returns false for non-Takeuchi number #{n}" do
25
+ n.should_not be_takeuchi
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,15 @@
1
+ # coding: utf-8
2
+ describe Integer, "#tetrahedral" do
3
+ # A000292
4
+ @seq = [0,1,4,10,20,35,56,84,120,165,220,286,364,455,560,
5
+ 680,816,969,1140,1330,1540,1771,2024,2300,2600,
6
+ 2925,3276,3654,4060,4495,4960,5456,5984,6545,7140,
7
+ 7770,8436,9139,9880,10660,11480,12341,13244,14190,
8
+ 15180]
9
+
10
+ @seq.each_with_index do |t, n|
11
+ it "returns #{t} for the #{n}#{n.ordinal} tetrahedral number" do
12
+ n.tetrahedral.should == t
13
+ end
14
+ end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.152.0
4
+ version: 0.170.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Run Paint Run Run
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-21 00:00:00 +00:00
12
+ date: 2010-03-26 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,102 +40,60 @@ files:
40
40
  - VERSION
41
41
  - lib/numb.rb
42
42
  - lib/numb/aban.rb
43
- - lib/numb/abundancy.rb
44
- - lib/numb/abundant.rb
45
43
  - lib/numb/achain.rb
46
- - lib/numb/achilles.rb
47
- - lib/numb/aliquot_sequence.rb
48
- - lib/numb/almost_perfect.rb
49
- - lib/numb/almost_prime.rb
50
44
  - lib/numb/amenable.rb
51
- - lib/numb/amicable.rb
52
45
  - lib/numb/apocalyptic.rb
53
- - lib/numb/aspiring.rb
54
- - lib/numb/augmented_amicable.rb
55
46
  - lib/numb/automorphic.rb
56
- - lib/numb/balanced_prime.rb
57
47
  - lib/numb/base.rb
58
48
  - lib/numb/beastly.rb
59
49
  - lib/numb/bell.rb
60
50
  - lib/numb/bernoulli.rb
61
- - lib/numb/betrothed.rb
62
51
  - lib/numb/binomial.rb
63
52
  - lib/numb/biquadratic.rb
64
53
  - lib/numb/blum.rb
65
- - lib/numb/breeder.rb
66
- - lib/numb/brilliant.rb
67
54
  - lib/numb/brown.rb
68
55
  - lib/numb/carmichael.rb
69
56
  - lib/numb/carol.rb
70
57
  - lib/numb/catalan.rb
71
- - lib/numb/centered_cube.rb
72
- - lib/numb/centered_hexagonal.rb
73
- - lib/numb/centered_n_gonal.rb
74
- - lib/numb/centered_pentagonal.rb
75
- - lib/numb/centered_square.rb
76
- - lib/numb/centered_triangular.rb
77
58
  - lib/numb/choose.rb
78
- - lib/numb/composite.rb
79
59
  - lib/numb/congruum.rb
80
60
  - lib/numb/consecutive.rb
81
- - lib/numb/coprime.rb
82
61
  - lib/numb/core.rb
83
62
  - lib/numb/cototient.rb
84
- - lib/numb/cube.rb
85
63
  - lib/numb/cullen.rb
86
64
  - lib/numb/cyclic.rb
87
- - lib/numb/d.rb
88
- - lib/numb/decagonal.rb
89
- - lib/numb/deficient.rb
90
65
  - lib/numb/delannoy.rb
91
66
  - lib/numb/demlo.rb
92
- - lib/numb/dihedral_prime.rb
93
- - lib/numb/dodecagonal.rb
67
+ - lib/numb/divisors.rb
68
+ - lib/numb/divisors/abundant.rb
69
+ - lib/numb/divisors/aliquot.rb
70
+ - lib/numb/divisors/amicable.rb
71
+ - lib/numb/divisors/perfect.rb
94
72
  - lib/numb/doubly_even.rb
95
73
  - lib/numb/dudeney.rb
96
- - lib/numb/e_divisors.rb
97
- - lib/numb/e_perfect.rb
98
74
  - lib/numb/eban.rb
99
- - lib/numb/economical.rb
100
- - lib/numb/emrip.rb
101
75
  - lib/numb/entringer.rb
102
- - lib/numb/equidigital.rb
103
76
  - lib/numb/euclid.rb
104
77
  - lib/numb/evil.rb
105
- - lib/numb/extravagant.rb
106
78
  - lib/numb/factorial.rb
107
79
  - lib/numb/factorion.rb
108
80
  - lib/numb/fermat.rb
109
- - lib/numb/fermat_pseudoprime.rb
110
81
  - lib/numb/fibonacci.rb
82
+ - lib/numb/figurate.rb
111
83
  - lib/numb/franel.rb
112
- - lib/numb/friendly.rb
113
84
  - lib/numb/frugal.rb
114
- - lib/numb/full_reptend_prime.rb
115
85
  - lib/numb/genocchi.rb
116
- - lib/numb/giuga.rb
117
86
  - lib/numb/gnomonic.rb
118
87
  - lib/numb/goldbach.rb
119
88
  - lib/numb/hamming.rb
120
89
  - lib/numb/happy.rb
121
- - lib/numb/harshad.rb
122
- - lib/numb/heptagonal.rb
123
- - lib/numb/hexagonal.rb
124
- - lib/numb/highly_abundant.rb
125
- - lib/numb/highly_composite.rb
126
90
  - lib/numb/hilbert.rb
127
- - lib/numb/hoax.rb
128
- - lib/numb/hyperperfect.rb
129
91
  - lib/numb/iban.rb
130
92
  - lib/numb/idempotent.rb
131
93
  - lib/numb/idoneal.rb
132
- - lib/numb/impolite.rb
133
- - lib/numb/infinitary_divisors.rb
134
- - lib/numb/infinitary_perfect.rb
94
+ - lib/numb/in_sequence.rb
135
95
  - lib/numb/integer_p.rb
136
- - lib/numb/interprime.rb
137
96
  - lib/numb/jacobsthal_lucas.rb
138
- - lib/numb/k_perfect.rb
139
97
  - lib/numb/kaprekar.rb
140
98
  - lib/numb/keith.rb
141
99
  - lib/numb/knodel.rb
@@ -145,106 +103,69 @@ files:
145
103
  - lib/numb/leonardo.rb
146
104
  - lib/numb/leyland.rb
147
105
  - lib/numb/lucas.rb
106
+ - lib/numb/lucas2.rb
148
107
  - lib/numb/lucas_carmichael.rb
149
108
  - lib/numb/lychrel.rb
150
109
  - lib/numb/mersenne.rb
151
- - lib/numb/mersenne_prime.rb
152
- - lib/numb/minimal.rb
153
110
  - lib/numb/mms_pair.rb
154
111
  - lib/numb/mobius.rb
155
112
  - lib/numb/modulo_order.rb
156
113
  - lib/numb/motzkin.rb
157
- - lib/numb/multiamicable.rb
158
- - lib/numb/myriagonal.rb
159
114
  - "lib/numb/m\xC3\xA9nage.rb"
160
- - lib/numb/n_gonal.rb
161
115
  - lib/numb/n_step_fibonacci.rb
162
116
  - lib/numb/narcissistic.rb
163
- - lib/numb/next_prev_prime.rb
164
117
  - lib/numb/nexus.rb
165
118
  - lib/numb/nivenmorphic.rb
166
119
  - lib/numb/noncototient.rb
167
120
  - lib/numb/nonhypotenuse.rb
168
121
  - lib/numb/nsw.rb
169
- - lib/numb/nth_prime.rb
170
- - lib/numb/number_of_divisors.rb
171
122
  - lib/numb/oban.rb
172
- - lib/numb/octagonal.rb
173
123
  - lib/numb/odious.rb
174
124
  - lib/numb/ordinal.rb
175
- - lib/numb/ore.rb
125
+ - lib/numb/palindrome.rb
176
126
  - lib/numb/pandigital.rb
177
127
  - lib/numb/parasitic.rb
178
- - lib/numb/pentagonal.rb
179
- - lib/numb/perfect.rb
180
- - lib/numb/perfect_power.rb
128
+ - lib/numb/pell_lucas.rb
181
129
  - lib/numb/perrin.rb
182
130
  - lib/numb/persistent.rb
183
- - lib/numb/polite.rb
184
131
  - lib/numb/polydivisible.rb
185
132
  - lib/numb/positive.rb
186
133
  - lib/numb/poulet.rb
187
- - lib/numb/powerful.rb
188
- - lib/numb/practical.rb
189
- - lib/numb/prime_count.rb
190
134
  - lib/numb/prime_power.rb
191
- - lib/numb/prime_signature.rb
192
- - lib/numb/primitive_pseudoperfect.rb
135
+ - lib/numb/primes.rb
193
136
  - lib/numb/primitive_root.rb
194
137
  - lib/numb/primitive_roots.rb
195
138
  - lib/numb/primorial.rb
196
139
  - lib/numb/pronic.rb
197
140
  - lib/numb/properties.rb
198
141
  - lib/numb/proth.rb
142
+ - lib/numb/q.rb
199
143
  - lib/numb/quarticfree.rb
200
144
  - lib/numb/refactorable.rb
201
145
  - lib/numb/repunit.rb
202
146
  - lib/numb/reverse.rb
203
- - lib/numb/rhonda.rb
204
- - lib/numb/rough.rb
205
- - lib/numb/safe_prime.rb
147
+ - "lib/numb/schr\xC3\xB6der.rb"
148
+ - lib/numb/segmented.rb
206
149
  - lib/numb/self.rb
207
150
  - lib/numb/self_descriptive.rb
208
- - lib/numb/semiperfect.rb
209
- - lib/numb/semiprime.rb
210
151
  - lib/numb/singly_even.rb
211
152
  - lib/numb/smarandache_wellin.rb
212
- - lib/numb/smith.rb
213
- - lib/numb/smooth.rb
214
- - lib/numb/sociable.rb
215
- - lib/numb/sophie_germain_prime.rb
216
153
  - lib/numb/sphenic.rb
217
- - lib/numb/square.rb
218
- - lib/numb/square_free.rb
219
- - lib/numb/square_triangular.rb
220
- - lib/numb/squared_triangular.rb
154
+ - lib/numb/stirling.rb
155
+ - lib/numb/stirling2.rb
221
156
  - lib/numb/strictly_non_palindromic.rb
222
157
  - "lib/numb/st\xC3\xB8rmer.rb"
223
158
  - lib/numb/subfactorial.rb
224
- - lib/numb/sublime.rb
225
- - lib/numb/sum_of_e_divisors.rb
226
- - lib/numb/sum_of_infinitary_divisors.rb
227
159
  - lib/numb/sum_of_squares.rb
228
- - lib/numb/sum_of_unitary_divisors.rb
229
- - lib/numb/super_poulet.rb
230
- - lib/numb/superabundant.rb
231
- - lib/numb/superperfect.rb
160
+ - lib/numb/super_catalan.rb
161
+ - lib/numb/super_d.rb
162
+ - lib/numb/takeuchi.rb
232
163
  - lib/numb/totient.rb
233
- - lib/numb/triangular.rb
234
164
  - lib/numb/trimorphic.rb
235
- - lib/numb/twin_prime.rb
236
165
  - lib/numb/uban.rb
237
166
  - lib/numb/undulating.rb
238
167
  - lib/numb/unhappy.rb
239
- - lib/numb/unitary_amicable.rb
240
- - lib/numb/unitary_divisor.rb
241
- - lib/numb/unitary_perfect.rb
242
- - lib/numb/unitary_sociable.rb
243
- - lib/numb/untouchable.rb
244
- - lib/numb/unusual.rb
245
168
  - lib/numb/vampire.rb
246
- - lib/numb/weird.rb
247
- - lib/numb/wieferich.rb
248
169
  - lib/numb/woodall.rb
249
170
  - lib/numb/words.rb
250
171
  - lib/numb/zeisel.rb
@@ -317,6 +238,7 @@ files:
317
238
  - spec/numb/fermat_pseudoprime_spec.rb
318
239
  - spec/numb/fermat_spec.rb
319
240
  - spec/numb/fibonacci_spec.rb
241
+ - spec/numb/first_with_n_divisors_spec.rb
320
242
  - spec/numb/franel_spec.rb
321
243
  - spec/numb/friendly_spec.rb
322
244
  - spec/numb/frugal_spec.rb
@@ -353,6 +275,7 @@ files:
353
275
  - spec/numb/lah_spec.rb
354
276
  - spec/numb/leonardo_spec.rb
355
277
  - spec/numb/leyland_spec.rb
278
+ - spec/numb/lucas2_spec.rb
356
279
  - spec/numb/lucas_carmichael_spec.rb
357
280
  - spec/numb/lucas_spec.rb
358
281
  - spec/numb/lychrel_spec.rb
@@ -368,6 +291,7 @@ files:
368
291
  - "spec/numb/m\xC3\xA9nage_spec.rb"
369
292
  - spec/numb/n_step_fibonacci_spec.rb
370
293
  - spec/numb/narcissistic_spec.rb
294
+ - spec/numb/near_square_spec.rb
371
295
  - spec/numb/nexus_spec.rb
372
296
  - spec/numb/nivenmorphic_spec.rb
373
297
  - spec/numb/noncototient_spec.rb
@@ -378,12 +302,16 @@ files:
378
302
  - spec/numb/number_of_prime_factors_spec.rb
379
303
  - spec/numb/oban_spec.rb
380
304
  - spec/numb/octagonal_spec.rb
305
+ - spec/numb/octahedral_spec.rb
381
306
  - spec/numb/odious_spec.rb
382
307
  - spec/numb/ordinal_spec.rb
383
308
  - spec/numb/ore_spec.rb
309
+ - spec/numb/palindrome_spec.rb
384
310
  - spec/numb/pandigital_spec.rb
385
311
  - spec/numb/parasitic_spec.rb
312
+ - spec/numb/pell_lucas_spec.rb
386
313
  - spec/numb/pentagonal_spec.rb
314
+ - spec/numb/pentatope_spec.rb
387
315
  - spec/numb/perfect_power_spec.rb
388
316
  - spec/numb/perfect_spec.rb
389
317
  - spec/numb/perrin_spec.rb
@@ -398,12 +326,15 @@ files:
398
326
  - spec/numb/prime_count_spec.rb
399
327
  - spec/numb/prime_power_spec.rb
400
328
  - spec/numb/prime_signature_spec.rb
329
+ - spec/numb/primitive_abundant_spec.rb
401
330
  - spec/numb/primitive_pseudoperfect_spec.rb
402
331
  - spec/numb/primitive_root_spec.rb
403
332
  - spec/numb/primitive_roots_spec.rb
404
333
  - spec/numb/primorial_spec.rb
405
334
  - spec/numb/pronic_spec.rb
406
335
  - spec/numb/proth_spec.rb
336
+ - spec/numb/pyramidal_spec.rb
337
+ - spec/numb/q_spec.rb
407
338
  - spec/numb/quarticfree_spec.rb
408
339
  - spec/numb/refactorable_spec.rb
409
340
  - spec/numb/repunit_spec.rb
@@ -411,6 +342,8 @@ files:
411
342
  - spec/numb/rhonda_spec.rb
412
343
  - spec/numb/rough_spec.rb
413
344
  - spec/numb/safe_prime_spec.rb
345
+ - "spec/numb/schr\xC3\xB6der_spec.rb"
346
+ - spec/numb/segmented_spec.rb
414
347
  - spec/numb/self_descriptive_spec.rb
415
348
  - spec/numb/self_spec.rb
416
349
  - spec/numb/semi_perfect_spec.rb
@@ -423,9 +356,14 @@ files:
423
356
  - spec/numb/sophie_germain_prime_spec.rb
424
357
  - spec/numb/sphenic_spec.rb
425
358
  - spec/numb/square_free_spec.rb
359
+ - spec/numb/square_part_spec.rb
426
360
  - spec/numb/square_spec.rb
427
361
  - spec/numb/square_triangular_spec.rb
428
362
  - spec/numb/squared_triangular_spec.rb
363
+ - spec/numb/star_spec.rb
364
+ - spec/numb/stella_octangula_spec.rb
365
+ - spec/numb/stirling2_spec.rb
366
+ - spec/numb/stirling_spec.rb
429
367
  - spec/numb/strictly_non_palindromic_spec.rb
430
368
  - "spec/numb/st\xC3\xB8rmer_spec.rb"
431
369
  - spec/numb/subfactorial_spec.rb
@@ -434,9 +372,13 @@ files:
434
372
  - spec/numb/sum_of_infinitary_divisors_spec.rb
435
373
  - spec/numb/sum_of_squares_spec.rb
436
374
  - spec/numb/sum_of_unitary_divisors_spec.rb
375
+ - spec/numb/super_catalan_spec.rb
376
+ - spec/numb/super_d_spec.rb
437
377
  - spec/numb/super_poulet_spec.rb
438
378
  - spec/numb/superabundant_spec.rb
439
379
  - spec/numb/superperfect_spec.rb
380
+ - spec/numb/takeuchi_spec.rb
381
+ - spec/numb/tetrahedral_spec.rb
440
382
  - spec/numb/totient_spec.rb
441
383
  - spec/numb/triangular_spec.rb
442
384
  - spec/numb/trimorphic_spec.rb
@@ -492,6 +434,7 @@ test_files:
492
434
  - spec/numb/economical_spec.rb
493
435
  - spec/numb/base_spec.rb
494
436
  - spec/numb/proth_spec.rb
437
+ - spec/numb/stella_octangula_spec.rb
495
438
  - spec/numb/prime_signature_spec.rb
496
439
  - spec/numb/mersenne_spec.rb
497
440
  - spec/numb/unitary_divisor_spec.rb
@@ -512,6 +455,7 @@ test_files:
512
455
  - spec/numb/modulo_order_spec.rb
513
456
  - spec/numb/sociable_spec.rb
514
457
  - spec/numb/unitary_perfect_spec.rb
458
+ - "spec/numb/schr\xC3\xB6der_spec.rb"
515
459
  - spec/numb/nivenmorphic_spec.rb
516
460
  - spec/numb/dudeney_spec.rb
517
461
  - spec/numb/centered_triangular_spec.rb
@@ -541,18 +485,22 @@ test_files:
541
485
  - spec/numb/squared_triangular_spec.rb
542
486
  - spec/numb/persistent_spec.rb
543
487
  - spec/numb/cullen_spec.rb
488
+ - spec/numb/palindrome_spec.rb
544
489
  - spec/numb/zerofree_spec.rb
545
490
  - spec/numb/eban_spec.rb
546
491
  - spec/numb/automorphic_spec.rb
547
492
  - spec/numb/fermat_spec.rb
493
+ - spec/numb/stirling_spec.rb
548
494
  - spec/numb/minimal_spec.rb
549
495
  - spec/numb/jacobsthal_lucas_spec.rb
550
496
  - spec/numb/aban_spec.rb
551
497
  - spec/numb/hyperperfect_spec.rb
498
+ - spec/numb/segmented_spec.rb
552
499
  - spec/numb/uban_spec.rb
553
500
  - spec/numb/zeisel_spec.rb
554
501
  - spec/numb/motzkin_spec.rb
555
502
  - spec/numb/primitive_roots_spec.rb
503
+ - spec/numb/first_with_n_divisors_spec.rb
556
504
  - spec/numb/smooth_spec.rb
557
505
  - spec/numb/d_spec.rb
558
506
  - spec/numb/heptagonal_spec.rb
@@ -562,9 +510,11 @@ test_files:
562
510
  - spec/numb/centered_n_gonal_spec.rb
563
511
  - spec/numb/highly_abundant_spec.rb
564
512
  - spec/numb/e_perfect_spec.rb
513
+ - spec/numb/super_catalan_spec.rb
565
514
  - spec/numb/augmented_amicable_spec.rb
566
515
  - spec/numb/rough_spec.rb
567
516
  - spec/numb/nonhypotenuse_spec.rb
517
+ - spec/numb/near_square_spec.rb
568
518
  - spec/numb/emrip_spec.rb
569
519
  - spec/numb/idempotent_spec.rb
570
520
  - spec/numb/nexus_spec.rb
@@ -572,9 +522,11 @@ test_files:
572
522
  - spec/numb/poulet_spec.rb
573
523
  - spec/numb/congruum_spec.rb
574
524
  - spec/numb/hamming_spec.rb
525
+ - spec/numb/octahedral_spec.rb
575
526
  - spec/numb/doubly_even_spec.rb
576
527
  - spec/numb/safe_prime_spec.rb
577
528
  - spec/numb/bell_spec.rb
529
+ - spec/numb/square_part_spec.rb
578
530
  - spec/numb/sublime_spec.rb
579
531
  - spec/numb/refactorable_spec.rb
580
532
  - spec/numb/subfactorial_spec.rb
@@ -588,6 +540,7 @@ test_files:
588
540
  - spec/numb/unitary_sociable_spec.rb
589
541
  - spec/numb/full_reptend_prime_spec.rb
590
542
  - spec/numb/vampire_spec.rb
543
+ - spec/numb/tetrahedral_spec.rb
591
544
  - spec/numb/dodecagonal_spec.rb
592
545
  - spec/numb/dihedral_prime_spec.rb
593
546
  - spec/numb/breeder_spec.rb
@@ -613,6 +566,8 @@ test_files:
613
566
  - spec/numb/highly_composite_spec.rb
614
567
  - spec/numb/frugal_spec.rb
615
568
  - spec/numb/divides_spec.rb
569
+ - spec/numb/takeuchi_spec.rb
570
+ - spec/numb/pentatope_spec.rb
616
571
  - spec/numb/odious_spec.rb
617
572
  - spec/numb/euclid_spec.rb
618
573
  - spec/numb/semiprime_spec.rb
@@ -626,6 +581,8 @@ test_files:
626
581
  - spec/numb/twin_prime_spec.rb
627
582
  - spec/numb/hexagonal_spec.rb
628
583
  - spec/numb/nsw_spec.rb
584
+ - spec/numb/primitive_abundant_spec.rb
585
+ - spec/numb/lucas2_spec.rb
629
586
  - spec/numb/genocchi_spec.rb
630
587
  - spec/numb/wieferich_prime_spec.rb
631
588
  - spec/numb/fibonacci_spec.rb
@@ -635,15 +592,18 @@ test_files:
635
592
  - spec/numb/semi_perfect_spec.rb
636
593
  - spec/numb/pentagonal_spec.rb
637
594
  - spec/numb/blum_spec.rb
595
+ - spec/numb/stirling2_spec.rb
638
596
  - spec/numb/demlo_spec.rb
639
597
  - spec/numb/smarandache_wellin_spec.rb
640
598
  - spec/numb/maris_mcgwire_sosa_pair_spec.rb
599
+ - spec/numb/pell_lucas_spec.rb
641
600
  - spec/numb/core_spec.rb
642
601
  - spec/numb/lucas_spec.rb
643
602
  - spec/numb/k_perfect_spec.rb
644
603
  - spec/numb/trimorphic_spec.rb
645
604
  - spec/numb/evil_spec.rb
646
605
  - spec/numb/harshad_spec.rb
606
+ - spec/numb/star_spec.rb
647
607
  - spec/numb/cube_spec.rb
648
608
  - spec/numb/ore_spec.rb
649
609
  - spec/numb/achain_spec.rb
@@ -651,6 +611,7 @@ test_files:
651
611
  - spec/numb/carol_spec.rb
652
612
  - spec/numb/powerful_spec.rb
653
613
  - spec/numb/prime_count_spec.rb
614
+ - spec/numb/q_spec.rb
654
615
  - spec/numb/primitive_root_spec.rb
655
616
  - spec/numb/weird_spec.rb
656
617
  - spec/numb/interprime_spec.rb
@@ -666,6 +627,8 @@ test_files:
666
627
  - spec/numb/multiamicable_spec.rb
667
628
  - spec/numb/super_poulet_spec.rb
668
629
  - spec/numb/sum_of_e_divisors_spec.rb
630
+ - spec/numb/pyramidal_spec.rb
631
+ - spec/numb/super_d_spec.rb
669
632
  - spec/numb/factorion_spec.rb
670
633
  - spec/numb/lah_spec.rb
671
634
  - spec/numb/undulating_spec.rb
@@ -1,8 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def abundancy
4
- Rational(σ, self)
5
- end
6
-
7
- memoize :abundancy
8
- end
data/lib/numb/abundant.rb DELETED
@@ -1,20 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- # An abundant number is a number n for which σ(n) > 2n. That is, the sum of
4
- # its divisors exceeds 2n. (See Integer#σ to compute the sum of the divisors
5
- # of an arbitrary integer).
6
- #
7
- # Returns true if the number is abundant; false otherwise. Aliased to
8
- # Integer#excessive?.
9
- #
10
- # 96.abundant? #=> true
11
- # 100.abundant? #=> true
12
- # 345.abundant? #=> false
13
- #
14
- def abundant?
15
- return false unless positive?
16
- σ > (2 * self)
17
- end
18
-
19
- alias :excessive? :abundant?
20
- end
data/lib/numb/achilles.rb DELETED
@@ -1,15 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
-
4
- # An Achilles number is powerful but not a perfect power.
5
- #
6
- # Returns true if self is an Achilles number; false otherwise.
7
- #
8
- # 1152.achilles? #=> true
9
- # 4563.achilles? #=> true
10
- # 100.achilles? #=> false
11
- #
12
- def achilles?
13
- powerful? and not perfect_power?
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def aliquot_sequence(max_iterations=(self > 100 ? 10 : sqrt),
4
- summatory_function=->(n){ n.aliquot_sum })
5
- sequence = [self]
6
- max_iterations.floor.times do |limit|
7
- sequence << summatory_function[sequence.last]
8
- break if sequence[0..-2].include?(sequence.last)
9
- return sequence << (1/0.0) if limit.consecutive?(max_iterations)
10
- end
11
- sequence
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- class Integer
2
- def almost_perfect?
3
- return true if self == 1
4
- proper_divisors.reduce(:+) == self - 1
5
- end
6
-
7
- alias :least_deficient? :almost_perfect?
8
- end
@@ -1,6 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def almost_prime?(k)
4
- Ω == k
5
- end
6
- end
data/lib/numb/amicable.rb DELETED
@@ -1,6 +0,0 @@
1
- class Integer
2
- def amicable?(other)
3
- n, m = [self, other].minmax
4
- m.multiamicable?(n, 1, 1)
5
- end
6
- end
data/lib/numb/aspiring.rb DELETED
@@ -1,8 +0,0 @@
1
- class Integer
2
- def aspiring?(max_iterations=10)
3
- return false if perfect?
4
- (last = aliquot_sequence(max_iterations).last).to_f.finite? ?
5
- last.perfect? :
6
- false
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def augmented_amicable?(n)
4
- m = self
5
- [m.σ, n.σ].all?{|sigma| sigma == m + n - 1}
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- class Integer
2
- def balanced_prime?
3
- return false unless prime? and self >= 5
4
- primes, before = Prime.each, 2
5
- primes.each do |prime|
6
- return ((before + primes.next) / 2) == self if prime == self
7
- before = prime
8
- end
9
- end
10
- end
@@ -1,8 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def betrothed?(m)
4
- σ == m.σ and consecutive?(σ - m)
5
- end
6
- alias :quasi_amicable? :betrothed?
7
- alias :reduced_amicable? :betrothed?
8
- end
data/lib/numb/breeder.rb DELETED
@@ -1,9 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def breeder?(b)
4
- a = self
5
- x = (a.σ - a).fdiv(b)
6
- abx = a + (b*x)
7
- (abx == a.σ) and (abx == b.σ * (x + 1))
8
- end
9
- end
@@ -1,7 +0,0 @@
1
- # coding: utf-8
2
- class Integer
3
- def brilliant?
4
- pfacts = prime_factors
5
- pfacts.size == 2 and pfacts.map{|f| f.to_s.size}.uniq.size == 1
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- class Integer
2
- def centered_cube?
3
- 1.upto(Math.cbrt(self)).any? do |n|
4
- self == n**3 + (n - 1) ** 3
5
- end
6
- end
7
- end
@@ -1,6 +0,0 @@
1
- class Integer
2
- def centered_hexagonal?
3
- n = self - 1
4
- n.divides?(6) and (n/6).triangular?
5
- end
6
- end
@@ -1,9 +0,0 @@
1
- class Integer
2
- def centered_n_gonal?(n)
3
- raise ArgumentError unless n > 2
4
- Rational(
5
- -n + Math.sqrt( n**2 - 8 * (n - n * self) ),
6
- 2 * n
7
- ).denominator == 1
8
- end
9
- end
@@ -1,6 +0,0 @@
1
- class Integer
2
- def centered_pentagonal?
3
- n = self - 1
4
- n.divides?(5) and (n/5).triangular?
5
- end
6
- end