A003686

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

I had a half baked notion that it might generate a set of primes, but was dissappointed at 371.

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

Leave a Comment

the joy of css sprites

Been having some fun with CSS sprites lately.

Here is on I did based on a doodle: spinning head.

It’s fun coming up with the offset to make the animation work!

The other day, I also played with the glitch developer api to make this goofy thing based off the example code: glitch demo.

If you put in ur player code, you can see ur guy pop in there!

Leave a Comment

all vi(m), all the time, plz!

UGH! EMACS AND PICO! GO AWAY!

export VISUAL=vim ; export EDITOR=vim ; set -o vi

Leave a Comment

Convert camel case to all caps underscored

Convert camel case to all caps underscored:

$ echo -e 'SomeNiceHTTPCandyTCPSocketWrapper\nSimpleExample\nMoreHTTPFun' \
  | sed 's,\([A-Z][A-Z]*\)\([A-Z]\),\1_\2,g;s,\([a-z]\)\([A-Z]\),\1_\2,g' \
  | tr '[a-z]' '[A-Z]'
SOME_NICE_HTTP_CANDY_TCP_SOCKET_WRAPPER
SIMPLE_EXAMPLE
MORE_HTTP_FUN

Leave a Comment

me sudo long time!

Feel like sudo is always asking your for ur password?

Add a line like this:


Defaults:YOU_USERNAME_GOES_HERE_DUDE timestamp_timeout=28800

to your /etc/sudoers and ride it all night long!

Leave a Comment

Older Posts »
Follow

Get every new post delivered to your Inbox.