Click or drag to resize

divisibilityDivisibility Method (BigInteger, BigInteger)

Get the number of times n can be evenly divided by b.

Namespace:  NumberStone
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static int Divisibility(
	this BigInteger n,
	BigInteger b
)

Parameters

n
Type: System.NumericsBigInteger
The dividend.
b
Type: System.NumericsBigInteger
The divisor.

Return Value

Type: Int32
The maximum power by which you can raise b and still have it divide n.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BigInteger. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Running time: O( log( log(n)/log(b) ) )

If n is larger than 64 bits, performs a binary search over the solution space (same computational complexity).

See Also