I tried solving the following problem in haskell:
Find the smallest number b with (a^b
mod 100) = 1 for every a with
gcd(a,100)=1
I tried this:
head[ b | a <- [1..], b <- [1..], (a^b `mod` 100) == 1, gcd a 100 == 1]
but this yields 1^1 as the first solution, which is not correct, it should be for every ; 3^1 is not a solution for example.
I think the correct solution is b=20 but I want it in haskell.
Find the smallest number b
with (a^b mod 100) = 1 for every a
[every a] with gcd(a,100)=1