math-exercises 3.0.214 → 3.0.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
  2. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
  3. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
  4. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
  5. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
  6. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
  7. package/lib/exercises/math/arithmetic/index.d.ts +7 -0
  8. package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
  9. package/lib/exercises/math/arithmetic/index.js +7 -0
  10. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
  11. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
  12. package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
  13. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
  14. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
  15. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
  16. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
  17. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
  18. package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
  19. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
  20. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
  21. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
  22. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
  23. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
  24. package/lib/exercises/math/arithmetic/whichDayInXDays.js +81 -0
  25. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
  26. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
  28. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  29. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  31. package/lib/exercises/math/calcul/index.d.ts +1 -0
  32. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/index.js +1 -0
  34. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
  35. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
  37. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
  38. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
  40. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
  41. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
  42. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
  43. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
  44. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
  45. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
  46. package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
  47. package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
  48. package/lib/exercises/math/calcul/ratio/index.js +1 -0
  49. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
  50. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
  51. package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
  52. package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
  53. package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
  54. package/lib/exercises/math/calcul/relatives/index.js +1 -0
  55. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
  56. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
  57. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
  58. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
  59. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
  60. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
  61. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  62. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  63. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  64. package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
  65. package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
  66. package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
  67. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
  68. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
  69. package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
  70. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
  71. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
  72. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
  73. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
  74. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
  75. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
  76. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
  77. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
  78. package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
  79. package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
  80. package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
  81. package/lib/exercises/math/complex/algebraic/index.js +10 -0
  82. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
  83. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
  84. package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
  85. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
  86. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
  87. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
  88. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
  89. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
  90. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
  91. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
  92. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
  93. package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
  94. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
  95. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
  96. package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
  97. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
  98. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
  99. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
  100. package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
  101. package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
  102. package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
  103. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
  104. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
  105. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
  106. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
  107. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
  108. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
  109. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
  110. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
  111. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
  112. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
  113. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
  114. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
  115. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
  116. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
  117. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
  118. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
  119. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
  120. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
  121. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
  122. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
  123. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
  124. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
  125. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
  126. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
  127. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
  128. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
  129. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
  130. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
  131. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
  132. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
  133. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
  134. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
  135. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
  136. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
  137. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
  138. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
  139. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
  140. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
  141. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
  142. package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
  143. package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
  144. package/lib/exercises/math/complex/geometric/index.js +19 -0
  145. package/lib/exercises/math/complex/index.d.ts +4 -10
  146. package/lib/exercises/math/complex/index.d.ts.map +1 -1
  147. package/lib/exercises/math/complex/index.js +4 -11
  148. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
  149. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
  150. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
  151. package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
  152. package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
  153. package/lib/exercises/math/complex/polynomials/index.js +3 -0
  154. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
  155. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
  156. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
  157. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
  158. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
  159. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
  160. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
  161. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
  162. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
  163. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
  164. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
  165. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
  166. package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
  167. package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
  168. package/lib/exercises/math/complex/unitRoots/index.js +2 -0
  169. package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
  170. package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
  171. package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
  172. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
  173. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
  174. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
  175. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
  176. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
  177. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
  178. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
  179. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
  180. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
  181. package/lib/exercises/math/conversion/clock/index.d.ts +3 -0
  182. package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
  183. package/lib/exercises/math/conversion/clock/index.js +4 -0
  184. package/lib/exercises/math/conversion/index.d.ts +1 -0
  185. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  186. package/lib/exercises/math/conversion/index.js +1 -0
  187. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
  188. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
  189. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
  190. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
  191. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
  192. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
  193. package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
  194. package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
  195. package/lib/exercises/math/geometry/angles/index.js +2 -0
  196. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
  197. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
  198. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
  199. package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
  200. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
  201. package/lib/exercises/math/geometry/circles/index.js +1 -0
  202. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
  203. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
  204. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
  205. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
  206. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
  207. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
  208. package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
  209. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  210. package/lib/exercises/math/geometry/lines/index.js +2 -0
  211. package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
  212. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  213. package/lib/exercises/math/geometry/triangles/index.js +2 -1
  214. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
  215. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
  216. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
  217. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
  218. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
  219. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
  220. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
  221. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
  222. package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
  223. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
  224. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
  225. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
  226. package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
  227. package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
  228. package/lib/exercises/math/geometry/volumes/index.js +1 -0
  229. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
  230. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
  231. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
  232. package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
  233. package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
  234. package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
  235. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
  236. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
  237. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
  238. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
  239. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
  240. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
  241. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  242. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  243. package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
  244. package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
  245. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  246. package/lib/geogebra/parsers/geogebraParser.js +27 -0
  247. package/lib/index.d.ts +213 -23
  248. package/lib/index.d.ts.map +1 -1
  249. package/lib/latexTester.js +2 -0
  250. package/lib/math/geometry/angle.d.ts.map +1 -1
  251. package/lib/math/geometry/angle.js +3 -0
  252. package/lib/math/geometry/segment.d.ts +1 -1
  253. package/lib/math/geometry/segment.d.ts.map +1 -1
  254. package/lib/math/geometry/segment.js +5 -2
  255. package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
  256. package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
  257. package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
  258. package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
  259. package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
  260. package/lib/math/utils/geometry/angleNWSE.js +56 -0
  261. package/lib/tests/singleExo.test.d.ts.map +1 -1
  262. package/lib/tests/singleExo.test.js +2 -2
  263. package/lib/utils/strings/frenchDays.d.ts +2 -0
  264. package/lib/utils/strings/frenchDays.d.ts.map +1 -0
  265. package/lib/utils/strings/frenchDays.js +9 -0
  266. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ mod: number;
4
+ a: number;
5
+ n: number;
6
+ };
7
+ export declare const findLeftInHugeNumberDivision: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=findLeftInHugeNumberDivision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findLeftInHugeNumberDivision.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/findLeftInHugeNumberDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CAEX,CAAC;AAqMF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
@@ -0,0 +1,194 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../exercises/vea/numberVEA.js";
4
+ import { randint } from "../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
7
+ import { doWhile } from "../../../utils/doWhile.js";
8
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
9
+ import { alignTex } from "../../../utils/latex/alignTex.js";
10
+ const getPropositions = (n, { answer, mod }) => {
11
+ const propositions = [];
12
+ addValidProp(propositions, answer);
13
+ propWhile(propositions, n, () => {
14
+ tryToAddWrongProp(propositions, randint(0, mod).frenchify());
15
+ });
16
+ return shuffleProps(propositions, n);
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const { a, mod, n } = identifiers;
20
+ const aMod = a % mod;
21
+ let cycle = 1;
22
+ let currentMod = aMod;
23
+ let cycleFound = false;
24
+ while (!cycleFound) {
25
+ cycle++;
26
+ currentMod = (currentMod * aMod) % mod;
27
+ if (currentMod === 1)
28
+ cycleFound = true;
29
+ }
30
+ const left = n % cycle;
31
+ currentMod = aMod;
32
+ for (let i = 1; i < left; i++) {
33
+ currentMod = (currentMod * aMod) % mod;
34
+ }
35
+ return currentMod.frenchify();
36
+ //a^cycle = 1 [mod]
37
+ };
38
+ const getInstruction = (identifiers) => {
39
+ const { a, mod, n } = identifiers;
40
+ return `Déterminer le reste de la division euclidienne de $${power(a, n).toTex()}$ par $${mod}$.`;
41
+ };
42
+ const getHint = (identifiers) => {
43
+ const { a, mod, n } = identifiers;
44
+ return `Calcule d'abord $${a} \\pmod ${mod}$.
45
+
46
+ Puis, par calculs successifs, détermine un nombre $n$ tel que $${a ^ n}\\equiv 1\\ [${mod}]$.
47
+
48
+ Cela permettra de simplifier le calcul.`;
49
+ };
50
+ const getCorrection = (identifiers) => {
51
+ const { a, mod, n } = identifiers;
52
+ const aMod = a % mod;
53
+ let cycle = 1;
54
+ let currentMod = aMod;
55
+ let cycleFound = false;
56
+ const powers = [];
57
+ while (!cycleFound) {
58
+ cycle++;
59
+ currentMod = (currentMod * aMod) % mod;
60
+ powers.push([
61
+ `${power(aMod, cycle).toTex()}`,
62
+ "\\equiv",
63
+ `${currentMod} \\ [${mod}]`,
64
+ ]);
65
+ if (currentMod === 1)
66
+ cycleFound = true;
67
+ }
68
+ const left = n % cycle;
69
+ currentMod = aMod;
70
+ for (let i = 1; i < left; i++) {
71
+ currentMod = (currentMod * aMod) % mod;
72
+ }
73
+ const answer = currentMod.frenchify();
74
+ const quot = Math.floor(n / cycle);
75
+ //a^cycle = 1 [mod]
76
+ return `On commence par déterminer le reste de la division euclidienne de $${a}$ par $${mod}$ :
77
+
78
+ $$
79
+ ${a} \\equiv ${aMod} \\ [${mod}]
80
+ $$
81
+
82
+ Ainsi,
83
+
84
+ $$
85
+ ${power(a, n).toTex()} \\equiv ${power(aMod, n).toTex()} \\ [${mod}]
86
+ $$
87
+
88
+ Puis, on calcule les puissances successives de $${aMod}$ modulo $${mod}$ :
89
+
90
+ ${alignTex(powers)}
91
+
92
+ On effectue alors la division euclidienne de $${n}$ par $${cycle}$ :
93
+
94
+ $$
95
+ ${n} = ${cycle}\\times ${quot} + ${left}
96
+ $$
97
+
98
+ Alors :
99
+
100
+ $$
101
+ ${power(aMod, n).toTex()} = ${multiply(power(power(aMod, cycle), quot), power(aMod, left)).toTex()}
102
+ $$
103
+
104
+ Et donc, modulo $${mod}$ :
105
+
106
+ $$
107
+ ${power(aMod, n).toTex()} \\equiv 1^{${quot}} \\times ${power(aMod, left).toTex()} \\equiv ${power(aMod, left).toTex()} \\ [${mod}]
108
+ $$
109
+
110
+ d'où, finalement :
111
+
112
+ $$
113
+ ${power(a, n).toTex()}\\equiv ${answer} \\ [${mod}]
114
+ $$
115
+
116
+ Le reste de la division euclidienne de $${power(a, n).toTex()}$ par $${mod}$ est donc $${answer}$.
117
+ `;
118
+ };
119
+ const getKeys = () => {
120
+ return [];
121
+ };
122
+ const isAnswerValid = (ans, { answer }) => {
123
+ try {
124
+ return numberVEA(ans, answer);
125
+ }
126
+ catch (err) {
127
+ return handleVEAError(err);
128
+ }
129
+ };
130
+ const getFindLeftInHugeNumberDivisionQuestion = () => {
131
+ let a = 0;
132
+ let mod = 0;
133
+ let found = false;
134
+ let counter = 0;
135
+ let n = 0;
136
+ do {
137
+ let cycle = 1;
138
+ counter++;
139
+ if (counter > 1000)
140
+ throw new Error("too many iterations in getFindLeftInHugeNumberDivisionQuestion");
141
+ mod = randint(5, 20);
142
+ a = randint(mod + 5, mod + 100);
143
+ n = doWhile(() => randint(100, 1000), (x) => x % mod === 0);
144
+ const aMod = a % mod;
145
+ if (aMod === 0 || aMod === 1 || aMod === mod - 1)
146
+ continue;
147
+ let currentMod = a % mod;
148
+ for (let i = 0; i < 5; i++) {
149
+ if (currentMod === 1) {
150
+ if (n % cycle === 0)
151
+ break;
152
+ found = true;
153
+ break;
154
+ }
155
+ cycle++;
156
+ currentMod = (currentMod * aMod) % mod;
157
+ }
158
+ } while (!found);
159
+ const identifiers = {
160
+ a,
161
+ mod,
162
+ n,
163
+ };
164
+ return getQuestionFromIdentifiers(identifiers);
165
+ };
166
+ const getQuestionFromIdentifiers = (identifiers) => {
167
+ return {
168
+ answer: getAnswer(identifiers),
169
+ instruction: getInstruction(identifiers),
170
+ keys: getKeys(identifiers),
171
+ answerFormat: "tex",
172
+ identifiers,
173
+ hint: getHint(identifiers),
174
+ correction: getCorrection(identifiers),
175
+ };
176
+ };
177
+ export const findLeftInHugeNumberDivision = {
178
+ id: "findLeftInHugeNumberDivision",
179
+ connector: "=",
180
+ label: "Calculer le reste de la division euclidienne de $a^n$ par $b$, pour des grandes valeurs de $a$ et $n$",
181
+ isSingleStep: true,
182
+ generator: (nb, opts) => getDistinctQuestions(() => getFindLeftInHugeNumberDivisionQuestion(opts), nb),
183
+ qcmTimer: 60,
184
+ freeTimer: 60,
185
+ getPropositions,
186
+ isAnswerValid,
187
+ subject: "Mathématiques",
188
+ getInstruction,
189
+ getHint,
190
+ getCorrection,
191
+ getAnswer,
192
+ getQuestionFromIdentifiers,
193
+ hasHintAndCorrection: true,
194
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ numbers: number[];
4
+ missingIndex: number;
5
+ };
6
+ export declare const findMissingNumberToMakeNumberDivisibleBy9: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=findMissingNumberToMakeNumberDivisibleBy9.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findMissingNumberToMakeNumberDivisibleBy9.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAgHF,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAAC,WAAW,CAuBzE,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../exercises/vea/numberVEA.js";
4
+ import { randint } from "../../../math/utils/random/randint.js";
5
+ import { randTupleInt } from "../../../math/utils/random/randTupleInt.js";
6
+ import { doWhile } from "../../../utils/doWhile.js";
7
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
8
+ const getPropositions = (n, { answer }) => {
9
+ const propositions = [];
10
+ addValidProp(propositions, answer);
11
+ propWhile(propositions, n, () => {
12
+ tryToAddWrongProp(propositions, randint(0, 100).frenchify());
13
+ });
14
+ return shuffleProps(propositions, n);
15
+ };
16
+ const getAnswer = (identifiers) => {
17
+ const { numbers } = identifiers;
18
+ const quotient = 9;
19
+ const sum = numbers.reduce((acc, curr) => acc + curr, 0);
20
+ const modulo = (sum + quotient) % quotient;
21
+ const missing = quotient - modulo;
22
+ return missing.frenchify();
23
+ };
24
+ const getInstruction = (identifiers) => {
25
+ const { numbers, missingIndex } = identifiers;
26
+ const trueNb = [
27
+ ...numbers.slice(0, missingIndex).map((e) => e + ""),
28
+ "a",
29
+ ...numbers.slice(missingIndex).map((e) => e + ""),
30
+ ];
31
+ return `On considère un nombre qui a pour écriture décimale :
32
+
33
+ $$
34
+ ${trueNb.join("")}
35
+ $$
36
+
37
+ Déterminer la valeur de $a$ pour que ce nombre soit divisible par $9$.`;
38
+ };
39
+ const getHint = () => {
40
+ return `Un nombre entier est divisible par $9$ si la somme de ses chiffres est divisible par $9$.`;
41
+ };
42
+ const getCorrection = (identifiers) => {
43
+ const { numbers, missingIndex } = identifiers;
44
+ const quotient = 9;
45
+ const sum = numbers.reduce((acc, curr) => acc + curr, 0);
46
+ const modulo = (sum + quotient) % quotient;
47
+ const missing = quotient - modulo;
48
+ const trueNb = [
49
+ ...numbers.slice(0, missingIndex).map((e) => e + ""),
50
+ missing.frenchify(),
51
+ ...numbers.slice(missingIndex).map((e) => e + ""),
52
+ ];
53
+ return `Un nombre entier est divisible par $9$ si la somme de ses chiffres est divisible par $9$.
54
+
55
+ La somme des chiffres connus du nombre proposé est :
56
+
57
+ $$
58
+ ${numbers.join("+")}=${sum}
59
+ $$
60
+
61
+ Le reste de la division euclidienne de $${sum}$ par $9$ est $${modulo}$.
62
+
63
+ Pour obtenir un multiple de $9$, il suffit donc d'ajouter $${missing}$ à cette somme.
64
+
65
+ Le nombre recherché est donc :
66
+
67
+ $$
68
+ ${trueNb.join("")}
69
+ $$`;
70
+ };
71
+ const getKeys = () => {
72
+ return [];
73
+ };
74
+ const isAnswerValid = (ans, { answer }) => {
75
+ try {
76
+ return numberVEA(ans, answer);
77
+ }
78
+ catch (err) {
79
+ return handleVEAError(err);
80
+ }
81
+ };
82
+ const getFindMissingNumberToMakeNumberDivisibleByXQuestion = () => {
83
+ const numbers = doWhile(() => randTupleInt(randint(4, 8), {
84
+ from: 1,
85
+ to: 10,
86
+ }), (arr) => arr.reduce((acc, curr) => acc + curr, 0) % 9 === 0);
87
+ const identifiers = {
88
+ numbers,
89
+ missingIndex: randint(0, numbers.length),
90
+ };
91
+ return getQuestionFromIdentifiers(identifiers);
92
+ };
93
+ const getQuestionFromIdentifiers = (identifiers) => {
94
+ return {
95
+ answer: getAnswer(identifiers),
96
+ instruction: getInstruction(identifiers),
97
+ keys: getKeys(identifiers),
98
+ answerFormat: "tex",
99
+ identifiers,
100
+ hint: getHint(identifiers),
101
+ correction: getCorrection(identifiers),
102
+ };
103
+ };
104
+ export const findMissingNumberToMakeNumberDivisibleBy9 = {
105
+ id: "findMissingNumberToMakeNumberDivisibleBy9",
106
+ connector: "=",
107
+ label: "Déterminer la valeur de $a$ pour que le nombre $xxaxx$ soit divisible par $9$",
108
+ isSingleStep: true,
109
+ generator: (nb, opts) => getDistinctQuestions(() => getFindMissingNumberToMakeNumberDivisibleByXQuestion(opts), nb),
110
+ qcmTimer: 60,
111
+ freeTimer: 60,
112
+ getPropositions,
113
+ isAnswerValid,
114
+ subject: "Mathématiques",
115
+ getInstruction,
116
+ getHint,
117
+ getCorrection,
118
+ getAnswer,
119
+ getQuestionFromIdentifiers,
120
+ hasHintAndCorrection: true,
121
+ };
@@ -7,4 +7,11 @@ export * from "./diophantianEquationSimpleSolution.js";
7
7
  export * from "./pgcdHomogenuity.js";
8
8
  export * from "./pgcdFromPrimeDecomposition.js";
9
9
  export * from "./fermatUsageOnBigPowers.js";
10
+ export * from "./whichDayInXDays.js";
11
+ export * from "./findMissingNumberToMakeNumberDivisibleBy9.js";
12
+ export * from "./findLeftInHugeNumberDivision.js";
13
+ export * from "./pgcdFromEuclid.js";
14
+ export * from "./isBigNumberPrime.js";
15
+ export * from "./solveDiophantianEquationByUsingPrimality.js";
16
+ export * from "./numberOfEndingZerosOfBigProduct.js";
10
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,sCAAsC,CAAC"}
@@ -7,3 +7,10 @@ export * from "./diophantianEquationSimpleSolution.js";
7
7
  export * from "./pgcdHomogenuity.js";
8
8
  export * from "./pgcdFromPrimeDecomposition.js";
9
9
  export * from "./fermatUsageOnBigPowers.js";
10
+ export * from "./whichDayInXDays.js";
11
+ export * from "./findMissingNumberToMakeNumberDivisibleBy9.js";
12
+ export * from "./findLeftInHugeNumberDivision.js";
13
+ export * from "./pgcdFromEuclid.js";
14
+ export * from "./isBigNumberPrime.js";
15
+ export * from "./solveDiophantianEquationByUsingPrimality.js";
16
+ export * from "./numberOfEndingZerosOfBigProduct.js";
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ };
5
+ export declare const isBigNumberPrime: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=isBigNumberPrime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBigNumberPrime.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/isBigNumberPrime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAkBlD,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { primes } from "../../../math/numbers/integer/primes.js";
4
+ import { isPrime } from "../../../math/utils/arithmetic/isPrime.js";
5
+ import { randint } from "../../../math/utils/random/randint.js";
6
+ import { sqrt } from "../../../tree/nodes/functions/sqrtNode.js";
7
+ import { coinFlip } from "../../../utils/alea/coinFlip.js";
8
+ import { doWhile } from "../../../utils/doWhile.js";
9
+ import { alignTex } from "../../../utils/latex/alignTex.js";
10
+ const getPropositions = (n, { answer }) => {
11
+ const propositions = [];
12
+ addValidProp(propositions, answer, "raw");
13
+ tryToAddWrongProp(propositions, "Oui", "raw");
14
+ tryToAddWrongProp(propositions, "Non", "raw");
15
+ tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
16
+ return shuffleProps(propositions, n);
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const { a } = identifiers;
20
+ return isPrime(a) ? "Oui" : "Non";
21
+ };
22
+ const getInstruction = (identifiers) => {
23
+ const { a } = identifiers;
24
+ return `$${a}$ est-il un nombre premier ?`;
25
+ };
26
+ const getHint = () => {
27
+ return `Utilise le test de primalité : si $n$ n'est divisible par aucun nombre premier inférieur ou égal à $\\sqrt{n}$, alors $n$ est premier.`;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const { a } = identifiers;
31
+ const nextSquare = (Math.floor(Math.sqrt(a)) + 1) ** 2;
32
+ const squareRootFloor = Math.floor(Math.sqrt(a));
33
+ const primesToTest = primes.filter((p) => p > 5 && p <= squareRootFloor);
34
+ const isPremier = isPrime(a);
35
+ const divisor = primesToTest.find((p) => a % p === 0);
36
+ return `On a $${a}<${nextSquare}$ et $${sqrt(nextSquare).toSimplificationTex()}$, donc :
37
+
38
+ $$
39
+ ${sqrt(a).toTex()}\\leq ${squareRootFloor}
40
+ $$
41
+
42
+ On teste donc la divisibilité de $${a}$ par tous les entiers premiers inférieurs ou égaux à $${squareRootFloor}$.
43
+
44
+ $${a}$ n'est pas divisible par $2$, $3$ et $5$ d'après les critères de divisibilité.
45
+
46
+ ${isPremier
47
+ ? `On effectue les divisions euclidiennes par les nombres premiers restants :
48
+
49
+ ${alignTex(primesToTest.map((p) => [
50
+ a.frenchify(),
51
+ "=",
52
+ `${p}\\times ${Math.floor(a / p).frenchify()}+ ${(a % p).frenchify()}`,
53
+ ]))}
54
+
55
+ $${a}$ n'est donc divisible par aucun nombre premier inférieur ou égal à sa racine carrée : c'est un nombre premier.`
56
+ : `On trouve cependant en effectuant des divisions euclidiennes :
57
+
58
+ $$
59
+ ${a} = ${divisor}\\times ${Math.floor(a / divisor)} + 0
60
+ $$
61
+
62
+ $${a}$ est donc divisible par $${divisor}$, donc il n'est pas premier.`}
63
+
64
+ `;
65
+ };
66
+ const getIsBigNumberPrimeQuestion = () => {
67
+ //a n'est pas un carré, ni divisible par 2, 3, 5,
68
+ //la racine doit etre strictement supérieur à 11 pour tester au moins 7 et 11
69
+ const generatePrime = coinFlip();
70
+ const a = doWhile(() => randint(127, 400), (x) => x % 2 === 0 ||
71
+ x % 3 === 0 ||
72
+ x % 5 === 0 ||
73
+ Math.sqrt(x) === Math.floor(Math.sqrt(x)) ||
74
+ (generatePrime && !isPrime(x)) ||
75
+ (!generatePrime && isPrime(x)));
76
+ const identifiers = { a };
77
+ return getQuestionFromIdentifiers(identifiers);
78
+ };
79
+ const getQuestionFromIdentifiers = (identifiers) => {
80
+ return {
81
+ answer: getAnswer(identifiers),
82
+ instruction: getInstruction(identifiers),
83
+ keys: [],
84
+ answerFormat: "raw",
85
+ identifiers,
86
+ hint: getHint(identifiers),
87
+ correction: getCorrection(identifiers),
88
+ };
89
+ };
90
+ export const isBigNumberPrime = {
91
+ id: "isBigNumberPrime",
92
+ connector: "=",
93
+ label: "Déterminer si un nombre (relativement grand) est premier",
94
+ isSingleStep: true,
95
+ generator: (nb, opts) => getDistinctQuestions(() => getIsBigNumberPrimeQuestion(opts), nb),
96
+ qcmTimer: 60,
97
+ freeTimer: 60,
98
+ getPropositions,
99
+ subject: "Mathématiques",
100
+ getInstruction,
101
+ getHint,
102
+ getCorrection,
103
+ getAnswer,
104
+ getQuestionFromIdentifiers,
105
+ hasHintAndCorrection: true,
106
+ answerType: "QCU",
107
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ };
6
+ export declare const numberOfEndingZerosOfBigProduct: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=numberOfEndingZerosOfBigProduct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberOfEndingZerosOfBigProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2IF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAsBjE,CAAC"}
@@ -0,0 +1,139 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../exercises/vea/numberVEA.js";
4
+ import { primeDecompNode } from "../../../math/utils/arithmetic/primeDecompNode.js";
5
+ import { primeDecomposition } from "../../../math/utils/arithmetic/primeDecomposition.js";
6
+ import { randint } from "../../../math/utils/random/randint.js";
7
+ import { randTupleInt } from "../../../math/utils/random/randTupleInt.js";
8
+ import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
9
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
10
+ import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
11
+ import { randomMany } from "../../../utils/alea/random.js";
12
+ import { doWhile } from "../../../utils/doWhile.js";
13
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
14
+ const getPropositions = (n, { answer }) => {
15
+ const propositions = [];
16
+ addValidProp(propositions, answer);
17
+ propWhile(propositions, n, () => {
18
+ tryToAddWrongProp(propositions, randint(0, 8).frenchify());
19
+ });
20
+ return shuffleProps(propositions, n);
21
+ };
22
+ const getAnswer = (identifiers) => {
23
+ const { a, b } = identifiers;
24
+ const aDecomp = primeDecomposition(a);
25
+ const bDecomp = primeDecomposition(b);
26
+ const twoPower = (aDecomp.find((el) => el.value === 2)?.power ?? 0) +
27
+ (bDecomp.find((el) => el.value === 2)?.power ?? 0);
28
+ const fivePower = (aDecomp.find((el) => el.value === 5)?.power ?? 0) +
29
+ (bDecomp.find((el) => el.value === 5)?.power ?? 0);
30
+ const commonPower = Math.min(twoPower, fivePower);
31
+ return commonPower.frenchify();
32
+ };
33
+ const getInstruction = (identifiers) => {
34
+ const { a, b } = identifiers;
35
+ return `Après avoir écrit la décomposition en facteurs premiers de chaque facteur, déterminer combien de zéros terminent l'écriture décimale du produit :
36
+
37
+ $$
38
+ ${a}\\times ${b}
39
+ $$`;
40
+ };
41
+ const getHint = () => {
42
+ return `L'écriture décimale d'un nombre se termine par $n$ zéros si et seulement si ce nombre est divisible par $10^n$.`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const { a, b } = identifiers;
46
+ const aDecomp = primeDecomposition(a);
47
+ const bDecomp = primeDecomposition(b);
48
+ const twoPower = (aDecomp.find((el) => el.value === 2)?.power ?? 0) +
49
+ (bDecomp.find((el) => el.value === 2)?.power ?? 0);
50
+ const fivePower = (aDecomp.find((el) => el.value === 5)?.power ?? 0) +
51
+ (bDecomp.find((el) => el.value === 5)?.power ?? 0);
52
+ const commonPower = Math.min(twoPower, fivePower);
53
+ return `On écrit la décomposition en facteurs premiers de chaque facteur du produit :
54
+
55
+ $$
56
+ ${a} = ${primeDecompNode(a).toTex()}
57
+ $$
58
+
59
+ $$
60
+ ${b} = ${primeDecompNode(b).toTex()}
61
+ $$
62
+
63
+ Le produit de ces deux nombres est donc divisible par $2^{${twoPower}}$ et par $5^{${fivePower}}$, donc il est divisible par $(2\\times 5)^{${commonPower}} = 10^{${commonPower}}$.
64
+
65
+ L'écriture décimle de ce produit se terminent donc par $${commonPower}$ zéro(s).
66
+
67
+ `;
68
+ };
69
+ const getKeys = () => {
70
+ return [];
71
+ };
72
+ const isAnswerValid = (ans, { answer }) => {
73
+ try {
74
+ return numberVEA(ans, answer);
75
+ }
76
+ catch (err) {
77
+ return handleVEAError(err);
78
+ }
79
+ };
80
+ const getNumberOfEndingZerosOfBigProductQuestion = () => {
81
+ const primes = [2, 3, 5, 7];
82
+ let a = 0;
83
+ let b = 0;
84
+ let answer = "";
85
+ do {
86
+ const aPrimes = randomMany(primes, randint(2, 4)).sort((a, b) => a - b);
87
+ const bPrimes = doWhile(() => randomMany(primes, randint(2, 4)), (list) => list.every((p) => !aPrimes.includes(p))).sort((a, b) => a - b);
88
+ const aPowers = randTupleInt(aPrimes.length, {
89
+ from: 1,
90
+ to: 5,
91
+ });
92
+ const bPowers = randTupleInt(bPrimes.length, {
93
+ from: 1,
94
+ to: 5,
95
+ excludes: [aPowers],
96
+ });
97
+ a = operatorComposition(MultiplyNode, aPrimes.map((p, i) => power(p, aPowers[i]))).evaluate();
98
+ b = operatorComposition(MultiplyNode, bPrimes.map((p, i) => power(p, bPowers[i]))).evaluate();
99
+ answer = getAnswer({ a, b });
100
+ } while (isNaN(a) ||
101
+ isNaN(b) ||
102
+ a < 1000 ||
103
+ b < 1000 ||
104
+ answer.unfrenchify() < 1);
105
+ const identifiers = {
106
+ a,
107
+ b,
108
+ };
109
+ return getQuestionFromIdentifiers(identifiers);
110
+ };
111
+ const getQuestionFromIdentifiers = (identifiers) => {
112
+ return {
113
+ answer: getAnswer(identifiers),
114
+ instruction: getInstruction(identifiers),
115
+ keys: getKeys(identifiers),
116
+ answerFormat: "tex",
117
+ identifiers,
118
+ hint: getHint(identifiers),
119
+ correction: getCorrection(identifiers),
120
+ };
121
+ };
122
+ export const numberOfEndingZerosOfBigProduct = {
123
+ id: "numberOfEndingZerosOfBigProduct",
124
+ connector: "=",
125
+ label: "Déterminer le nombre de zéros terminant l'écriture décimale d'un produit de grands nombres",
126
+ isSingleStep: true,
127
+ generator: (nb, opts) => getDistinctQuestions(() => getNumberOfEndingZerosOfBigProductQuestion(opts), nb),
128
+ qcmTimer: 60,
129
+ freeTimer: 60,
130
+ getPropositions,
131
+ isAnswerValid,
132
+ subject: "Mathématiques",
133
+ getInstruction,
134
+ getHint,
135
+ getCorrection,
136
+ getAnswer,
137
+ getQuestionFromIdentifiers,
138
+ hasHintAndCorrection: true,
139
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ };
6
+ export declare const pgcdFromEuclid: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=pgcdFromEuclid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pgcdFromEuclid.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/pgcdFromEuclid.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CAEX,CAAC;AAoHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}