+0  
 
0
80
2
avatar

Find the number of solutions to 3x + y = 100 in positive integers.

 Jun 3, 2020
 #1
avatar
0

d=0;a=1; b=1;c=3*a + b; if(c==100, goto5, goto7);d=d+1;printd,"-", a, b; a++;if(a<200, goto3, 0);a=1;b++;if(b<200, goto3, discard=0;print d
n   x  y
1 - 33 1
2 - 32 4
3 - 31 7
4 - 30 10
5 - 29 13
6 - 28 16
7 - 27 19
8 - 26 22
9 - 25 25
10 - 24 28
11 - 23 31
12 - 22 34
13 - 21 37
14 - 20 40
15 - 19 43
16 - 18 46
17 - 17 49
18 - 16 52
19 - 15 55
20 - 14 58
21 - 13 61
22 - 12 64
23 - 11 67
24 - 10 70
25 - 9 73
26 - 8 76
27 - 7 79
28 - 6 82
29 - 5 85
30 - 4 88
31 - 3 91
32 - 2 94
33 - 1 97

 Jun 3, 2020
 #2
avatar+107 
0

great answer, guest! :)

NoWorkNeeded  Jun 3, 2020

9 Online Users