Answer: There is 22 possible combinations.
Explanation:
%a is equal or greater then 11 and it is odd
count=0;
P=[];
for a=11:2:499
b=a+2;
%assume a and b are prime;
prime=1;
%check if a and b are prime
for k=2:ceil(sqrt(b))
%if a OR b is divisible by k, break
%it is not prime
if mod(a, k)==0 | mod(b, k)==0
prime=0;
break;
end
end
if prime
count=count+1;
P(count, :)=[a b];
end
end
fprintf('There is %d possible combinations.\\', count)
display(P)
There is 22 possible combinations.
P =
11 13
17 19
29 31
41 43
59 61
71 73
101 103
107 109
137 139
149 151
179 181
191 193
197 199
227 229
239 241
269 271
281 283
311 313
347 349
419 421
431 433
461 463