This site is supported by donations to The OEIS Foundation.

Talk:Style sheet for Mathematica programs

From OeisWiki
Jump to: navigation, search

Quick note on versions: I'm using 7.0 and have access to 5.2. — Alonso del Arte 00:34, 13 March 2011 (UTC)

About the first line

First line:

Technically, the only requirement for a Mathematica program in the OEIS is that it provide the correct results; it doesn't matter if its logic is faulty somehow, or even if it calls for doing "impossible" things like dividing by zero if the right results are nevertheless delivered.

That surprises me! — Daniel Forgues 20:01, 18 July 2011 (UTC)

Consider a program to cull out integers divisible by the product of their base 10 digits. You could go to the trouble of setting up a test to skip over numbers with any nonleading zeroes. Or you could go to the trouble of asking Mathematica to suppress the error messages before going into the testing loop and then restore error messages. Or you could just let Mathematica go into the testing loop with no preparation, put up with two or three divide by zero messages and then a message telling you that further divide by zero messages will be suppressed. — Alonso del Arte 04:30, 19 July 2011 (UTC)
I'd rather have a program with no error messages or warnings, clean logic and syntax, etc... For example, I would use Max[digit, 1] in the loop. — Daniel Forgues 23:19, 19 July 2011 (UTC)
So I guess here I did not come up with the best example. Now that I look at my program for A007602 after all these years, I remember that I sidestepped division by zero by having zuckerQ make sure the product is not 0 prior to the division. In other cases, it might be a simple matter of starting an iterator at 2 or 3 rather than 1 (as was the case with one of Harvey's programs for which he actually considered turning off error messages).
Anyway, perhaps we all have evolved to such a point that we demand clean logic and syntax but don't mind one or two error messages. Alonso del Arte 00:00, 20 July 2011 (UTC)