CoCoA:FactorMultiplicity

From ApCoCoAWiki

FactorMultiplicity

multiplicity of a factor of an integer

Description

This function counts how many times a give factor divides a given

integer. Obviously Fac must not be -1, 0, or 1, and N must not be zero.

Example

  FactorMultiplicity(20, 2);
2
-------------------------------
  FactorMultiplicity(20, 10);
1
-------------------------------
  FactorMultiplicity(20, 7);
0
-------------------------------

Syntax

FactorMultiplicity(N:INT, Fac:INT):INT
   <type>int</type>