Coprimes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{--

From the P-99 Prolog problem set, exercise 33: coprimality.

Two integers are coprime if their greatest common divisor is 1.

P33: Determine whether two integers are coprime: --}

data CoPrime = CoPrime Integer Integer
   deriving Show
data CoComposite =
    CoComposite { a :: Integer, b :: Integer,  exempli_gratia :: Integer }
   deriving Show

coprime :: Integer -> Integer -> Either CoPrime CoComposite
coprime a b = undefined

{-- 

Specifically, are the following number pairs coprime, if not, prove (or
counter-prove) they are not by producing a common factor greater than one.

The first two answers are provided.

a) 91245979	18211570	CoPrime
á) 76779654	2624340		CoComposite, exempli_gratia = 6
b) 22373537	16993305
d) 91251012	2784034
ð) 7663739	47537650
e) 86513675	7669917
é) 85891852	63428723
f) 15503901	85895700
g) 31982302	90125051
h) 97823598	85631050
i) 17380683	74696928
í) 81561621	95190700
j) 11635887	8645601
k) 66949253	40993744
l) 73283906	53717210
m) 4170817	42949996
n) 65366428	47796033
o) 1031137	22251410
ó) 55765011	53035953
p) 71790684	21607514
r) 93339395	68106578
s) 21636197	5541357
t) 90635974	90661702
u) 73316048	87732563
ú) 76216545	35135410
v) 62967518	31910986
x) 39888199	57250871
y) 14126109	14607057
ý) 67664871	67884032
þ) 85196042	65138766
æ) 83463295	3120879
ö) 43471387	82986575

(thank you, random.org)

(Letters are of the íslenska stafrófið)

A solution is available at http://lpaste.net/107843

 --}
11:1: Warning: Use camelCase
Found:
data CoComposite = CoComposite{a :: Integer, b :: Integer,
exempli_gratia :: Integer}
deriving Show
Why not:
data CoComposite = CoComposite{a :: Integer, b :: Integer,
exempliGratia :: Integer}
deriving Show