few more algos

Get greatest common denominator

public int GCD(int a, int b) {
   if (b==0) return a;
   return GCD(b,a%b);
}

Maximum value for a number of a specific base with N digits

Power(Base, N) – 1

Number N is prime or not

Check if number is divisible from 2 till root(N)

Leave a comment