Talk:Sum to 100: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎extra credit: moved the complete list of solutions of "9" from the "page" area.)
Line 76: Line 76:
solution: 9 ◄───► 12-34-56+78+9
solution: 9 ◄───► 12-34-56+78+9
46 solutions found for 9
46 solutions found for 9
</pre>

==complete list of the number of solutions for zero ──► 300==
For those that are interested in the density of solutions:
<pre>
22 solutions found for 0
43 solutions found for 1
18 solutions found for 2
41 solutions found for 3
18 solutions found for 4
40 solutions found for 5
24 solutions found for 6
39 solutions found for 7
18 solutions found for 8
46 solutions found for 9
17 solutions found for 10
38 solutions found for 11
27 solutions found for 12
38 solutions found for 13
24 solutions found for 14
43 solutions found for 15
18 solutions found for 16
39 solutions found for 17
23 solutions found for 18
37 solutions found for 19
23 solutions found for 20
43 solutions found for 21
25 solutions found for 22
36 solutions found for 23
32 solutions found for 24
36 solutions found for 25
25 solutions found for 26
44 solutions found for 27
25 solutions found for 28
35 solutions found for 29
34 solutions found for 30
31 solutions found for 31
26 solutions found for 32
37 solutions found for 33
24 solutions found for 34
35 solutions found for 35
32 solutions found for 36
32 solutions found for 37
27 solutions found for 38
37 solutions found for 39
31 solutions found for 40
26 solutions found for 41
34 solutions found for 42
34 solutions found for 43
29 solutions found for 44
42 solutions found for 45
27 solutions found for 46
27 solutions found for 47
35 solutions found for 48
26 solutions found for 49
28 solutions found for 50
35 solutions found for 51
29 solutions found for 52
33 solutions found for 53
30 solutions found for 54
26 solutions found for 55
23 solutions found for 56
29 solutions found for 57
32 solutions found for 58
25 solutions found for 59
33 solutions found for 60
30 solutions found for 61
24 solutions found for 62
34 solutions found for 63
22 solutions found for 64
26 solutions found for 65
32 solutions found for 66
30 solutions found for 67
25 solutions found for 68
29 solutions found for 69
22 solutions found for 70
25 solutions found for 71
26 solutions found for 72
24 solutions found for 73
22 solutions found for 74
26 solutions found for 75
25 solutions found for 76
22 solutions found for 77
24 solutions found for 78
25 solutions found for 79
19 solutions found for 80
31 solutions found for 81
20 solutions found for 82
23 solutions found for 83
25 solutions found for 84
21 solutions found for 85
18 solutions found for 86
23 solutions found for 87
17 solutions found for 88
24 solutions found for 89
21 solutions found for 90
22 solutions found for 91
21 solutions found for 92
23 solutions found for 93
17 solutions found for 94
17 solutions found for 95
19 solutions found for 96
21 solutions found for 97
15 solutions found for 98
25 solutions found for 99
12 solutions found for 100
18 solutions found for 101
19 solutions found for 102
14 solutions found for 103
14 solutions found for 104
18 solutions found for 105
18 solutions found for 106
17 solutions found for 107
19 solutions found for 108
12 solutions found for 109
14 solutions found for 110
19 solutions found for 111
13 solutions found for 112
12 solutions found for 113
17 solutions found for 114
15 solutions found for 115
14 solutions found for 116
20 solutions found for 117
13 solutions found for 118
11 solutions found for 119
18 solutions found for 120
10 solutions found for 121
9 solutions found for 122
13 solutions found for 123
12 solutions found for 124
12 solutions found for 125
19 solutions found for 126
8 solutions found for 127
12 solutions found for 128
12 solutions found for 129
13 solutions found for 130
7 solutions found for 131
15 solutions found for 132
14 solutions found for 133
8 solutions found for 134
16 solutions found for 135
10 solutions found for 136
5 solutions found for 137
15 solutions found for 138
7 solutions found for 139
10 solutions found for 140
10 solutions found for 141
10 solutions found for 142
9 solutions found for 143
14 solutions found for 144
8 solutions found for 145
8 solutions found for 146
11 solutions found for 147
9 solutions found for 148
6 solutions found for 149
10 solutions found for 150
9 solutions found for 151
6 solutions found for 152
13 solutions found for 153
9 solutions found for 154
6 solutions found for 155
10 solutions found for 156
8 solutions found for 157
4 solutions found for 158
8 solutions found for 159
5 solutions found for 160
4 solutions found for 161
11 solutions found for 162
5 solutions found for 163
6 solutions found for 164
7 solutions found for 165
4 solutions found for 166
5 solutions found for 167
3 solutions found for 168
8 solutions found for 169
4 solutions found for 170
10 solutions found for 171
6 solutions found for 172
4 solutions found for 173
5 solutions found for 174
3 solutions found for 175
1 solution found for 176
6 solutions found for 177
3 solutions found for 178
3 solutions found for 179
7 solutions found for 180
2 solutions found for 181
4 solutions found for 182
4 solutions found for 183
3 solutions found for 184
5 solutions found for 185
4 solutions found for 186
5 solutions found for 187
4 solutions found for 188
6 solutions found for 189
6 solutions found for 190
1 solution found for 191
4 solutions found for 192
2 solutions found for 193
1 solution found for 194
4 solutions found for 195
1 solution found for 196
3 solutions found for 197
7 solutions found for 198
3 solutions found for 199
3 solutions found for 200
4 solutions found for 201
2 solutions found for 202
3 solutions found for 203
2 solutions found for 204
2 solutions found for 205
2 solutions found for 206
6 solutions found for 207
4 solutions found for 208
1 solution found for 209
5 solutions found for 210
no solutions found for 211
4 solutions found for 212
1 solution found for 213
3 solutions found for 214
1 solution found for 215
6 solutions found for 216
1 solution found for 217
3 solutions found for 218
no solutions found for 219
3 solutions found for 220
no solutions found for 221
4 solutions found for 222
1 solution found for 223
4 solutions found for 224
2 solutions found for 225
5 solutions found for 226
no solutions found for 227
4 solutions found for 228
no solutions found for 229
3 solutions found for 230
2 solutions found for 231
2 solutions found for 232
no solutions found for 233
5 solutions found for 234
no solutions found for 235
3 solutions found for 236
1 solution found for 237
3 solutions found for 238
no solutions found for 239
6 solutions found for 240
no solutions found for 241
5 solutions found for 242
3 solutions found for 243
6 solutions found for 244
2 solutions found for 245
5 solutions found for 246
no solutions found for 247
2 solutions found for 248
3 solutions found for 249
2 solutions found for 250
2 solutions found for 251
7 solutions found for 252
1 solution found for 253
4 solutions found for 254
2 solutions found for 255
5 solutions found for 256
2 solutions found for 257
7 solutions found for 258
1 solution found for 259
4 solutions found for 260
3 solutions found for 261
3 solutions found for 262
1 solution found for 263
4 solutions found for 264
4 solutions found for 265
2 solutions found for 266
5 solutions found for 267
2 solutions found for 268
2 solutions found for 269
6 solutions found for 270
2 solutions found for 271
1 solution found for 272
3 solutions found for 273
1 solution found for 274
1 solution found for 275
3 solutions found for 276
no solutions found for 277
4 solutions found for 278
3 solutions found for 279
4 solutions found for 280
4 solutions found for 281
2 solutions found for 282
4 solutions found for 283
no solutions found for 284
2 solutions found for 285
no solutions found for 286
no solutions found for 287
2 solutions found for 288
1 solution found for 289
1 solution found for 290
2 solutions found for 291
1 solution found for 292
1 solution found for 293
3 solutions found for 294
1 solution found for 295
3 solutions found for 296
2 solutions found for 297
2 solutions found for 298
2 solutions found for 299
no solutions found for 300

sum of 9 has the maximum number of solutions: 46
sums of 211 219 221 227 229 233 235 239 241 247 277 284 286 287 300 have the minimum number of solutions: 0
</pre>
</pre>

Revision as of 00:28, 5 January 2017

A 'sum' that can be shown but not expressed ?

Not sure that I have understood your third request. Something that can be 'shown' but not 'expressed' ? Sounds appeallingly ineffable and mysterious, but perhaps not entirely clear ...

Judging by your undo of my first suggestion, I guess that you are not simply looking for the first or lowest-valued integer than can't be expressed as a sum constructed in this way, but then I don't actually have any idea of what you are asking for. Perhaps some kind of example or concretisation might clarify ? Hout (talk) 01:42, 1 January 2017 (UTC)

See the REXX's output to help understand what is required.   I have changed the word   first   to   lowest   which is much clearer to what was intended   (I knew what I meant, but it was somewhat unclear in this context).   (Note that negative sums/integers are possible, these sums are just negative "versions" of the positive sums, so the requirement was worded to avoid looking for negative results.)   Since the sums are integers (as there is no way to get a non-integer sum from additions and/or subtractions of decimal digits or whole numbers).   I used the word "expressed" as it isn't necessary to have the expression "shown".   The word "shown" (to me) seems to indicate to display, not necessarily to express (in this case, mathematically).   To answer your question, yes, it is possible.   Showing something doesn't mean that it is being expressed   (in the sense that it is being understood).   I believe it boils down to word choices.   I was trying for a concise wording of the requirement without being unnecessarily wordy (or obtuse).   It's a fine art.   -- Gerard Schildberger (talk) 02:04, 1 January 2017 (UTC)
I've also added a trailing phrase to the 3rd requirement that (I think) fits in more to what you originally addressed.   -- Gerard Schildberger (talk) 02:09, 1 January 2017 (UTC)
Would it be consistent with your meaning to replace the word 'sum' with 'integer' ? Also if you are looking for the lowest integer that is inexpressible in these terms, perhaps it would be helpful to give an example of a higher integer of this kind, and demonstrate/explain its inexpressibility within this system ? Hout (talk) 02:16, 1 January 2017 (UTC)
I used the word sum because it was already used in the task's preamble and the word was also defined (in context).   Introducing another word (integer) would, I think, just belabor the effort to have another version of the sum word.   The next number   (after 211)   that can't be expressed within the rules is   219.   Another example of a sum that can't be expressed is   5791.   I'm not sure how to demonstrate/explain its inexpressibility other than to show (display)   all   the possible mathematical expressions that don't (can't) express the   5791   sum.   This would be somewhat of a strange proof (and voluminous), but not unheard of.   -- Gerard Schildberger (talk) 02:29, 1 January 2017 (UTC)
FWIW my experience as a reader is that using the word 'sum' at that point certainly proved confusing at first reading, and even now feels distractingly odd. 211 is certainly a number – a member of the set of integers – but the point you are making about it seems to be precisely that it is not a sum (the result of an addition) within this system. Hout (talk) 02:38, 1 January 2017 (UTC)
I'm not saying that 211 isn't an integer or a number --- just that it (the sum of 211) can't be expressed mathematically in the context of the rules for this puzzle as stated in the task's preamble.   211 is a sum (in particular, the lowest sum) of the set of sums that can't be expressed within the rules.   -- Gerard Schildberger (talk) 02:56, 1 January 2017 (UTC)
PS on the issue of an example; an existence proof would be fine – you could just give an example of a number like 5791, say that it can't be expressed by a sum that is restricted to these permutations of digits and signs, and ask for code that finds the lowest positive integer that shares this property. Hout (talk) 02:46, 1 January 2017 (UTC)
That seems overly wordy just to ask for the lowest positive sum that can't be expressed (within the rules).   In particular, the requirement was expressly worded to find   that   sum.   However, I will add an example (i.e.:   such as 5074).   -- Gerard Schildberger (talk) 02:56, 1 January 2017 (UTC)


extra credit

I had initially thought to add an extra credit solution for the   largest   sum   (except for the obvious   123456789).   I'm not sure it would be a worthwhile (optional) requirement, it could be pretty CPU intensive.   -- Gerard Schildberger (talk) 04:21, 1 January 2017 (UTC)

complete list of solutions for   9

For those that are interested (or need a sanity check), the 46 solutions (for the sum of 9) are:

solution:  9  ◄───►  -1+2+3+4+5+6+7-8-9
solution:  9  ◄───►  -1+2+3-4+5-6-7+8+9
solution:  9  ◄───►  -1+2+3-4-5+6+7-8+9
solution:  9  ◄───►  -1+2+3-45+67-8-9
solution:  9  ◄───►  -1+2+34+56+7-89
solution:  9  ◄───►  -1+2-3+4+5-6+7-8+9
solution:  9  ◄───►  -1+2-3+4-5+6+7+8-9
solution:  9  ◄───►  -1+23+4+5+67-89
solution:  9  ◄───►  -1+23+4-5-6-7-8+9
solution:  9  ◄───►  -1+23-4+5-6-7+8-9
solution:  9  ◄───►  -1+23-4-5+6+7-8-9
solution:  9  ◄───►  -1-2+3+4+5+6-7-8+9
solution:  9  ◄───►  -1-2+3+4+5-6+7+8-9
solution:  9  ◄───►  -1-2+3-4-5-6+7+8+9
solution:  9  ◄───►  -1-2+3-4-56+78-9
solution:  9  ◄───►  -1-2-3+4-5+6-7+8+9
solution:  9  ◄───►  -1-2-3+45-6-7-8-9
solution:  9  ◄───►  -1-2-3-4+5+6+7-8+9
solution:  9  ◄───►  -1-2-34+56+7-8-9
solution:  9  ◄───►  -1-23+45-6-7-8+9
solution:  9  ◄───►  -12+3-45-6+78-9
solution:  9  ◄───►  -12+34+5+6-7-8-9
solution:  9  ◄───►  -12+34+56-78+9
solution:  9  ◄───►  -12-34+5+67-8-9
solution:  9  ◄───►  1+2+3+4-5-6-7+8+9
solution:  9  ◄───►  1+2+3-4+5-6+7-8+9
solution:  9  ◄───►  1+2+3-4-5+6+7+8-9
solution:  9  ◄───►  1+2-3+4+5+6-7-8+9
solution:  9  ◄───►  1+2-3+4+5-6+7+8-9
solution:  9  ◄───►  1+2-3-4-5-6+7+8+9
solution:  9  ◄───►  1+2-3-4-56+78-9
solution:  9  ◄───►  1+2-34-56+7+89
solution:  9  ◄───►  1+23+4-5-6-7+8-9
solution:  9  ◄───►  1+23-4+5-6+7-8-9
solution:  9  ◄───►  1+23-45+6+7+8+9
solution:  9  ◄───►  1-2+3+4+5+6-7+8-9
solution:  9  ◄───►  1-2+3-4-5+6-7+8+9
solution:  9  ◄───►  1-2-3+4+5-6-7+8+9
solution:  9  ◄───►  1-2-3+4-5+6+7-8+9
solution:  9  ◄───►  1-2-3-4+5+6+7+8-9
solution:  9  ◄───►  1-2-3-4-5-67+89
solution:  9  ◄───►  1-23+4+5-67+89
solution:  9  ◄───►  1-23+45-6-7+8-9
solution:  9  ◄───►  1-23-4+5+6+7+8+9
solution:  9  ◄───►  1-23-45-6-7+89
solution:  9  ◄───►  12-34-56+78+9
       46 solutions found for 9

complete list of the number of solutions for zero ──► 300

For those that are interested in the density of solutions:

       22 solutions found for   0
       43 solutions found for   1
       18 solutions found for   2
       41 solutions found for   3
       18 solutions found for   4
       40 solutions found for   5
       24 solutions found for   6
       39 solutions found for   7
       18 solutions found for   8
       46 solutions found for   9
       17 solutions found for  10
       38 solutions found for  11
       27 solutions found for  12
       38 solutions found for  13
       24 solutions found for  14
       43 solutions found for  15
       18 solutions found for  16
       39 solutions found for  17
       23 solutions found for  18
       37 solutions found for  19
       23 solutions found for  20
       43 solutions found for  21
       25 solutions found for  22
       36 solutions found for  23
       32 solutions found for  24
       36 solutions found for  25
       25 solutions found for  26
       44 solutions found for  27
       25 solutions found for  28
       35 solutions found for  29
       34 solutions found for  30
       31 solutions found for  31
       26 solutions found for  32
       37 solutions found for  33
       24 solutions found for  34
       35 solutions found for  35
       32 solutions found for  36
       32 solutions found for  37
       27 solutions found for  38
       37 solutions found for  39
       31 solutions found for  40
       26 solutions found for  41
       34 solutions found for  42
       34 solutions found for  43
       29 solutions found for  44
       42 solutions found for  45
       27 solutions found for  46
       27 solutions found for  47
       35 solutions found for  48
       26 solutions found for  49
       28 solutions found for  50
       35 solutions found for  51
       29 solutions found for  52
       33 solutions found for  53
       30 solutions found for  54
       26 solutions found for  55
       23 solutions found for  56
       29 solutions found for  57
       32 solutions found for  58
       25 solutions found for  59
       33 solutions found for  60
       30 solutions found for  61
       24 solutions found for  62
       34 solutions found for  63
       22 solutions found for  64
       26 solutions found for  65
       32 solutions found for  66
       30 solutions found for  67
       25 solutions found for  68
       29 solutions found for  69
       22 solutions found for  70
       25 solutions found for  71
       26 solutions found for  72
       24 solutions found for  73
       22 solutions found for  74
       26 solutions found for  75
       25 solutions found for  76
       22 solutions found for  77
       24 solutions found for  78
       25 solutions found for  79
       19 solutions found for  80
       31 solutions found for  81
       20 solutions found for  82
       23 solutions found for  83
       25 solutions found for  84
       21 solutions found for  85
       18 solutions found for  86
       23 solutions found for  87
       17 solutions found for  88
       24 solutions found for  89
       21 solutions found for  90
       22 solutions found for  91
       21 solutions found for  92
       23 solutions found for  93
       17 solutions found for  94
       17 solutions found for  95
       19 solutions found for  96
       21 solutions found for  97
       15 solutions found for  98
       25 solutions found for  99
       12 solutions found for 100
       18 solutions found for 101
       19 solutions found for 102
       14 solutions found for 103
       14 solutions found for 104
       18 solutions found for 105
       18 solutions found for 106
       17 solutions found for 107
       19 solutions found for 108
       12 solutions found for 109
       14 solutions found for 110
       19 solutions found for 111
       13 solutions found for 112
       12 solutions found for 113
       17 solutions found for 114
       15 solutions found for 115
       14 solutions found for 116
       20 solutions found for 117
       13 solutions found for 118
       11 solutions found for 119
       18 solutions found for 120
       10 solutions found for 121
        9 solutions found for 122
       13 solutions found for 123
       12 solutions found for 124
       12 solutions found for 125
       19 solutions found for 126
        8 solutions found for 127
       12 solutions found for 128
       12 solutions found for 129
       13 solutions found for 130
        7 solutions found for 131
       15 solutions found for 132
       14 solutions found for 133
        8 solutions found for 134
       16 solutions found for 135
       10 solutions found for 136
        5 solutions found for 137
       15 solutions found for 138
        7 solutions found for 139
       10 solutions found for 140
       10 solutions found for 141
       10 solutions found for 142
        9 solutions found for 143
       14 solutions found for 144
        8 solutions found for 145
        8 solutions found for 146
       11 solutions found for 147
        9 solutions found for 148
        6 solutions found for 149
       10 solutions found for 150
        9 solutions found for 151
        6 solutions found for 152
       13 solutions found for 153
        9 solutions found for 154
        6 solutions found for 155
       10 solutions found for 156
        8 solutions found for 157
        4 solutions found for 158
        8 solutions found for 159
        5 solutions found for 160
        4 solutions found for 161
       11 solutions found for 162
        5 solutions found for 163
        6 solutions found for 164
        7 solutions found for 165
        4 solutions found for 166
        5 solutions found for 167
        3 solutions found for 168
        8 solutions found for 169
        4 solutions found for 170
       10 solutions found for 171
        6 solutions found for 172
        4 solutions found for 173
        5 solutions found for 174
        3 solutions found for 175
        1 solution found for 176
        6 solutions found for 177
        3 solutions found for 178
        3 solutions found for 179
        7 solutions found for 180
        2 solutions found for 181
        4 solutions found for 182
        4 solutions found for 183
        3 solutions found for 184
        5 solutions found for 185
        4 solutions found for 186
        5 solutions found for 187
        4 solutions found for 188
        6 solutions found for 189
        6 solutions found for 190
        1 solution found for 191
        4 solutions found for 192
        2 solutions found for 193
        1 solution found for 194
        4 solutions found for 195
        1 solution found for 196
        3 solutions found for 197
        7 solutions found for 198
        3 solutions found for 199
        3 solutions found for 200
        4 solutions found for 201
        2 solutions found for 202
        3 solutions found for 203
        2 solutions found for 204
        2 solutions found for 205
        2 solutions found for 206
        6 solutions found for 207
        4 solutions found for 208
        1 solution found for 209
        5 solutions found for 210
       no solutions found for 211
        4 solutions found for 212
        1 solution found for 213
        3 solutions found for 214
        1 solution found for 215
        6 solutions found for 216
        1 solution found for 217
        3 solutions found for 218
       no solutions found for 219
        3 solutions found for 220
       no solutions found for 221
        4 solutions found for 222
        1 solution found for 223
        4 solutions found for 224
        2 solutions found for 225
        5 solutions found for 226
       no solutions found for 227
        4 solutions found for 228
       no solutions found for 229
        3 solutions found for 230
        2 solutions found for 231
        2 solutions found for 232
       no solutions found for 233
        5 solutions found for 234
       no solutions found for 235
        3 solutions found for 236
        1 solution found for 237
        3 solutions found for 238
       no solutions found for 239
        6 solutions found for 240
       no solutions found for 241
        5 solutions found for 242
        3 solutions found for 243
        6 solutions found for 244
        2 solutions found for 245
        5 solutions found for 246
       no solutions found for 247
        2 solutions found for 248
        3 solutions found for 249
        2 solutions found for 250
        2 solutions found for 251
        7 solutions found for 252
        1 solution found for 253
        4 solutions found for 254
        2 solutions found for 255
        5 solutions found for 256
        2 solutions found for 257
        7 solutions found for 258
        1 solution found for 259
        4 solutions found for 260
        3 solutions found for 261
        3 solutions found for 262
        1 solution found for 263
        4 solutions found for 264
        4 solutions found for 265
        2 solutions found for 266
        5 solutions found for 267
        2 solutions found for 268
        2 solutions found for 269
        6 solutions found for 270
        2 solutions found for 271
        1 solution found for 272
        3 solutions found for 273
        1 solution found for 274
        1 solution found for 275
        3 solutions found for 276
       no solutions found for 277
        4 solutions found for 278
        3 solutions found for 279
        4 solutions found for 280
        4 solutions found for 281
        2 solutions found for 282
        4 solutions found for 283
       no solutions found for 284
        2 solutions found for 285
       no solutions found for 286
       no solutions found for 287
        2 solutions found for 288
        1 solution found for 289
        1 solution found for 290
        2 solutions found for 291
        1 solution found for 292
        1 solution found for 293
        3 solutions found for 294
        1 solution found for 295
        3 solutions found for 296
        2 solutions found for 297
        2 solutions found for 298
        2 solutions found for 299
       no solutions found for 300

sum of  9  has the maximum number of solutions:  46
sums of  211 219 221 227 229 233 235 239 241 247 277 284 286 287 300  have the minimum number of solutions:  0