a table of integers and their factors

Just a brief one again. The main take-away point is to demonstrate how we can compose new operators out of existing operators.
-- define some operators:
sa: factors |*> #=> factor |_self>
sa: count-factors |*> #=> count-sum factor |_self>
sa: prime |*> #=> if(is-equal[1] count-factors |_self>,|prime>,count-factors|_self>)

-- now show the table:
sa: table[number,factors,prime] range(|number: 1>,|number: 250>)
+--------+-------------+-------+
| number | factors     | prime |
+--------+-------------+-------+
| 1      |             | 0     |
| 2      | 2           | prime |
| 3      | 3           | prime |
| 4      | 2 2         | 2     |
| 5      | 5           | prime |
| 6      | 2, 3        | 2     |
| 7      | 7           | prime |
| 8      | 3 2         | 3     |
| 9      | 2 3         | 2     |
| 10     | 2, 5        | 2     |
| 11     | 11          | prime |
| 12     | 2 2, 3      | 3     |
| 13     | 13          | prime |
| 14     | 2, 7        | 2     |
| 15     | 3, 5        | 2     |
| 16     | 4 2         | 4     |
| 17     | 17          | prime |
| 18     | 2, 2 3      | 3     |
| 19     | 19          | prime |
| 20     | 2 2, 5      | 3     |
| 21     | 3, 7        | 2     |
| 22     | 2, 11       | 2     |
| 23     | 23          | prime |
| 24     | 3 2, 3      | 4     |
| 25     | 2 5         | 2     |
| 26     | 2, 13       | 2     |
| 27     | 3 3         | 3     |
| 28     | 2 2, 7      | 3     |
| 29     | 29          | prime |
| 30     | 2, 3, 5     | 3     |
| 31     | 31          | prime |
| 32     | 5 2         | 5     |
| 33     | 3, 11       | 2     |
| 34     | 2, 17       | 2     |
| 35     | 5, 7        | 2     |
| 36     | 2 2, 2 3    | 4     |
| 37     | 37          | prime |
| 38     | 2, 19       | 2     |
| 39     | 3, 13       | 2     |
| 40     | 3 2, 5      | 4     |
| 41     | 41          | prime |
| 42     | 2, 3, 7     | 3     |
| 43     | 43          | prime |
| 44     | 2 2, 11     | 3     |
| 45     | 2 3, 5      | 3     |
| 46     | 2, 23       | 2     |
| 47     | 47          | prime |
| 48     | 4 2, 3      | 5     |
| 49     | 2 7         | 2     |
| 50     | 2, 2 5      | 3     |
| 51     | 3, 17       | 2     |
| 52     | 2 2, 13     | 3     |
| 53     | 53          | prime |
| 54     | 2, 3 3      | 4     |
| 55     | 5, 11       | 2     |
| 56     | 3 2, 7      | 4     |
| 57     | 3, 19       | 2     |
| 58     | 2, 29       | 2     |
| 59     | 59          | prime |
| 60     | 2 2, 3, 5   | 4     |
| 61     | 61          | prime |
| 62     | 2, 31       | 2     |
| 63     | 2 3, 7      | 3     |
| 64     | 6 2         | 6     |
| 65     | 5, 13       | 2     |
| 66     | 2, 3, 11    | 3     |
| 67     | 67          | prime |
| 68     | 2 2, 17     | 3     |
| 69     | 3, 23       | 2     |
| 70     | 2, 5, 7     | 3     |
| 71     | 71          | prime |
| 72     | 3 2, 2 3    | 5     |
| 73     | 73          | prime |
| 74     | 2, 37       | 2     |
| 75     | 3, 2 5      | 3     |
| 76     | 2 2, 19     | 3     |
| 77     | 7, 11       | 2     |
| 78     | 2, 3, 13    | 3     |
| 79     | 79          | prime |
| 80     | 4 2, 5      | 5     |
| 81     | 4 3         | 4     |
| 82     | 2, 41       | 2     |
| 83     | 83          | prime |
| 84     | 2 2, 3, 7   | 4     |
| 85     | 5, 17       | 2     |
| 86     | 2, 43       | 2     |
| 87     | 3, 29       | 2     |
| 88     | 3 2, 11     | 4     |
| 89     | 89          | prime |
| 90     | 2, 2 3, 5   | 4     |
| 91     | 7, 13       | 2     |
| 92     | 2 2, 23     | 3     |
| 93     | 3, 31       | 2     |
| 94     | 2, 47       | 2     |
| 95     | 5, 19       | 2     |
| 96     | 5 2, 3      | 6     |
| 97     | 97          | prime |
| 98     | 2, 2 7      | 3     |
| 99     | 2 3, 11     | 3     |
| 100    | 2 2, 2 5    | 4     |
| 101    | 101         | prime |
| 102    | 2, 3, 17    | 3     |
| 103    | 103         | prime |
| 104    | 3 2, 13     | 4     |
| 105    | 3, 5, 7     | 3     |
| 106    | 2, 53       | 2     |
| 107    | 107         | prime |
| 108    | 2 2, 3 3    | 5     |
| 109    | 109         | prime |
| 110    | 2, 5, 11    | 3     |
| 111    | 3, 37       | 2     |
| 112    | 4 2, 7      | 5     |
| 113    | 113         | prime |
| 114    | 2, 3, 19    | 3     |
| 115    | 5, 23       | 2     |
| 116    | 2 2, 29     | 3     |
| 117    | 2 3, 13     | 3     |
| 118    | 2, 59       | 2     |
| 119    | 7, 17       | 2     |
| 120    | 3 2, 3, 5   | 5     |
| 121    | 2 11        | 2     |
| 122    | 2, 61       | 2     |
| 123    | 3, 41       | 2     |
| 124    | 2 2, 31     | 3     |
| 125    | 3 5         | 3     |
| 126    | 2, 2 3, 7   | 4     |
| 127    | 127         | prime |
| 128    | 7 2         | 7     |
| 129    | 3, 43       | 2     |
| 130    | 2, 5, 13    | 3     |
| 131    | 131         | prime |
| 132    | 2 2, 3, 11  | 4     |
| 133    | 7, 19       | 2     |
| 134    | 2, 67       | 2     |
| 135    | 3 3, 5      | 4     |
| 136    | 3 2, 17     | 4     |
| 137    | 137         | prime |
| 138    | 2, 3, 23    | 3     |
| 139    | 139         | prime |
| 140    | 2 2, 5, 7   | 4     |
| 141    | 3, 47       | 2     |
| 142    | 2, 71       | 2     |
| 143    | 11, 13      | 2     |
| 144    | 4 2, 2 3    | 6     |
| 145    | 5, 29       | 2     |
| 146    | 2, 73       | 2     |
| 147    | 3, 2 7      | 3     |
| 148    | 2 2, 37     | 3     |
| 149    | 149         | prime |
| 150    | 2, 3, 2 5   | 4     |
| 151    | 151         | prime |
| 152    | 3 2, 19     | 4     |
| 153    | 2 3, 17     | 3     |
| 154    | 2, 7, 11    | 3     |
| 155    | 5, 31       | 2     |
| 156    | 2 2, 3, 13  | 4     |
| 157    | 157         | prime |
| 158    | 2, 79       | 2     |
| 159    | 3, 53       | 2     |
| 160    | 5 2, 5      | 6     |
| 161    | 7, 23       | 2     |
| 162    | 2, 4 3      | 5     |
| 163    | 163         | prime |
| 164    | 2 2, 41     | 3     |
| 165    | 3, 5, 11    | 3     |
| 166    | 2, 83       | 2     |
| 167    | 167         | prime |
| 168    | 3 2, 3, 7   | 5     |
| 169    | 2 13        | 2     |
| 170    | 2, 5, 17    | 3     |
| 171    | 2 3, 19     | 3     |
| 172    | 2 2, 43     | 3     |
| 173    | 173         | prime |
| 174    | 2, 3, 29    | 3     |
| 175    | 2 5, 7      | 3     |
| 176    | 4 2, 11     | 5     |
| 177    | 3, 59       | 2     |
| 178    | 2, 89       | 2     |
| 179    | 179         | prime |
| 180    | 2 2, 2 3, 5 | 5     |
| 181    | 181         | prime |
| 182    | 2, 7, 13    | 3     |
| 183    | 3, 61       | 2     |
| 184    | 3 2, 23     | 4     |
| 185    | 5, 37       | 2     |
| 186    | 2, 3, 31    | 3     |
| 187    | 11, 17      | 2     |
| 188    | 2 2, 47     | 3     |
| 189    | 3 3, 7      | 4     |
| 190    | 2, 5, 19    | 3     |
| 191    | 191         | prime |
| 192    | 6 2, 3      | 7     |
| 193    | 193         | prime |
| 194    | 2, 97       | 2     |
| 195    | 3, 5, 13    | 3     |
| 196    | 2 2, 2 7    | 4     |
| 197    | 197         | prime |
| 198    | 2, 2 3, 11  | 4     |
| 199    | 199         | prime |
| 200    | 3 2, 2 5    | 5     |
| 201    | 3, 67       | 2     |
| 202    | 2, 101      | 2     |
| 203    | 7, 29       | 2     |
| 204    | 2 2, 3, 17  | 4     |
| 205    | 5, 41       | 2     |
| 206    | 2, 103      | 2     |
| 207    | 2 3, 23     | 3     |
| 208    | 4 2, 13     | 5     |
| 209    | 11, 19      | 2     |
| 210    | 2, 3, 5, 7  | 4     |
| 211    | 211         | prime |
| 212    | 2 2, 53     | 3     |
| 213    | 3, 71       | 2     |
| 214    | 2, 107      | 2     |
| 215    | 5, 43       | 2     |
| 216    | 3 2, 3 3    | 6     |
| 217    | 7, 31       | 2     |
| 218    | 2, 109      | 2     |
| 219    | 3, 73       | 2     |
| 220    | 2 2, 5, 11  | 4     |
| 221    | 13, 17      | 2     |
| 222    | 2, 3, 37    | 3     |
| 223    | 223         | prime |
| 224    | 5 2, 7      | 6     |
| 225    | 2 3, 2 5    | 4     |
| 226    | 2, 113      | 2     |
| 227    | 227         | prime |
| 228    | 2 2, 3, 19  | 4     |
| 229    | 229         | prime |
| 230    | 2, 5, 23    | 3     |
| 231    | 3, 7, 11    | 3     |
| 232    | 3 2, 29     | 4     |
| 233    | 233         | prime |
| 234    | 2, 2 3, 13  | 4     |
| 235    | 5, 47       | 2     |
| 236    | 2 2, 59     | 3     |
| 237    | 3, 79       | 2     |
| 238    | 2, 7, 17    | 3     |
| 239    | 239         | prime |
| 240    | 4 2, 3, 5   | 6     |
| 241    | 241         | prime |
| 242    | 2, 2 11     | 3     |
| 243    | 5 3         | 5     |
| 244    | 2 2, 61     | 3     |
| 245    | 5, 2 7      | 3     |
| 246    | 2, 3, 41    | 3     |
| 247    | 13, 19      | 2     |
| 248    | 3 2, 31     | 4     |
| 249    | 3, 83       | 2     |
| 250    | 2, 3 5      | 4     |
+--------+-------------+-------+
I guess that is it for this post. I hope it is clear what I was trying to show!

Maybe I should also mention it really highlights the location of twin primes.


Home
previous: top level domains in sw format
next: mapping webpages to well defined superpositions

updated: 19/12/2016
by Garry Morrison
email: garry -at- semantic-db.org