A few weeks ago I had an idea for generating this sequence based on the following rules:
- populate the initial set with [1,2]
- at each iteration
- calculate the product of all the elements of the set except the last
- add the last element to this product and append it to the set
It seemed unlikely that I was the first person to think of this set, but http://oeis.org/A003686 was the only result for my google search of “1, 2, 3, 5, 11, 41, 371″
No idea what dude is talking about, but I thought it was interesting…
Here is a link to the awk script: primo.awk.
Here is some output before it gets sign extended:
[ 1, 2 ] : 1 + 2 = 3 [ 1, 2, 3 ] : 2 + 3 = 5 [ 1, 2, 3, 5 ] : 6 + 5 = 11 [ 1, 2, 3, 5, 11 ] : 30 + 11 = 41 [ 1, 2, 3, 5, 11, 41 ] : 330 + 41 = 371 [ 1, 2, 3, 5, 11, 41, 371 ] : 13530 + 371 = 13901 [ 1, 2, 3, 5, 11, 41, 371, 13901 ] : 5019630 + 13901 = 5033531 [ 1, 2, 3, 5, 11, 41, 371, 13901, 5033531 ] : 69777876630 + 5033531 = 69782910161 [ 1, 2, 3, 5, 11, 41, 371, 13901, 5033531, 69782910161 ] : 351229105131280512 + 69782910161 = 351229174914190656
