-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhints.txt
More file actions
34 lines (24 loc) · 821 Bytes
/
hints.txt
File metadata and controls
34 lines (24 loc) · 821 Bytes
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
1 0 1 1*2^2 + 0*2^1 + 1* 2^0 = 1+4+8+32+64 = 109
quotient i=0
101101 ---> 10110 1*2^0 num/10 =quotient remainder
+
---> 1011 0*2^1 quotient = num
+ quotient = quotient/10 remainder= quotient%10
---> 101 1*2^2 sum = sum + remainder*2^(i-1)
i=i+1
while(quotient !=0)
Check if a number is sum of two primes
take a numner num
num = 2 + (num - 2)
prime? prime?
num = 3 + (num - 3)
prime? prime?
num = 4 + (num - 4)
prime? prime?
.
.
.
.
upto what? answer: (n - 2)
Decide whether to use a loop or not. If yes, what should we do inside the loop?
Yes, you need