This site is supported by donations to The OEIS Foundation.
Talk:Style Sheet
From OeisWiki
Standard mathematical notation for multiplication
I think no "absolute" rule is yet established for notation of multiplication in formulae. IMHO, the asterisk " * " is an artifact of programming languages and definitely not the symbol used by humans (and in other scientific journals) to denote multiplication (usually denoted by absence of a symbol, especially in a case like "3n+1" but also (a+b)(a-b) = a²-b²). So I'm slightly in favor of writing formulae without the " * ", at least in the before mentioned case -- even if I admit that it can be handy to be able to make a copy-paste of the formula into the PARI or Maple window... In case of doubt (i.e., absence of a strict rule for which consensus has been reached), the original author's choice should be preserved, IMO. But this is probably not the opinion of everyone, and other points of view could be defended here. — M. F. Hasler 23:36, 29 November 2010 (UTC)
- When I thought we were going to have a complete change-over to the wiki, I would have agreed that the asterisk should be reserved for the program (e.g., Maple, Mathematica) fields. Alonso del Arte 00:30, 30 November 2010 (UTC)
- That's my feeling as well. Charles R Greathouse IV 07:46, 5 February 2011 (UTC)
I regret the insistence on the ugly asterisk by some editors. Although the style sheet says: "Both 6n^2+17n+1 and 6*n^2+17*n+1 are acceptable." Some editors with a strong programming background flood the OEIS with asterisks. This is not the way every pupil learns to write a multiplication past elementary-school, a teacher uses multiplication on the blackboard or a professional writes in papers.
Don Knuth often uses Mathematica and one of the reasons he likes Mathematica is that it does not force him to write those '*'s.
I like Shaw's "Do not do unto others as you would that they should do unto you. Their tastes may not be the same." A general guiding principle like "The notation should follow as close as possible to the standard mathematical practice" together with respect for other tastes might also be a good idea. As seen here: "Both 6n^2+17n+1 and 6*n^2+17*n+1 are acceptable." Peter Luschny 12:11, 16 September 2011 (UTC)
Comments
Excellent! This section is very important and necessary. Neil writes: "This is not essential, since the same information is available in the History section, but it is useful for the reader who is in a hurry." In my opinion, the most important page of an encyclopaedia is usually the final page of the entry, where we should be able to read the available informations about the entry. Also I think that the "History" section, between various changes and corrections, it could become difficult to read in future. Thanks all for this great work! - Bruno Berselli 09:44, 30 November 2010 (UTC)
Neil writes: "Multiplication sign: use * rather than X or ×. Both 6n^2+17n+1 and 6*n^2+17*n+1 are acceptable". Thanks for this clarification. Bruno Berselli 13:17, 08 December 2010 (UTC)
Lines ending in period or not
I wonder whether it is on purpose that the "LINKS" lines are not terminated by a period ".", while "REFERENCES" are, same for EXTENSIONS vs AUTHOR. (Since it is rather AUTHOR which only consists in name + date, while EXTENSION usually is a phrase, one might have expected the opposite convention.) — M. F. Hasler 10:34, 7 December 2010 (UTC)
gamma, Pi, phi (or tau), ... (lowercase or uppercase?)
Is there a general rule (or is it ad hoc) for the case of name of constants?
Although 3.14159... is represented by the lowercase Greek letter
(not
,) in the OEIS we use Pi (instead of pi) as the latinized version of the name.
In
A001620 Decimal expansion of Euler's constant (or Euler-Mascheroni constant) gamma.
A001622 Decimal expansion of golden ratio phi (or tau) = (1 + sqrt 5 )/2.
lowercase gamma, phi (or tau) is used... — Daniel Forgues 07:42, 12 December 2010 (UTC)
- I think the use of "Pi" instead of "pi" is an artifact coming from programming languages, and hope (and expect) it will disappear one day, sooner or later (probably rather the latter...).
- That might be from the day on where unicode is allowed, then we will use the symbol π, as well as the symbol × instead of "X" (quite ugly, IMO, and I'd strongly prefer "x" whenever there can't be an ambiguity). — M. F. Hasler 12:18, 26 January 2013 (UTC)
Zeroeth or zeroth
Is "zeroth" better in:
The zeroeth (also spelled zeroth) power of 0 (The special case of zero to the zeroeth power.) — Daniel Forgues 06:01, 13 December 2010 (UTC)
- AFAICS, it should be zeroth, cf. http://en.wikipedia.org/wiki/Zeroth and http://en.wiktonary.org/zeroth/. — M. F. Hasler 02:41, 26 November 2012 (UTC)
Minimum number of terms
I think I've seen before that it is 4 terms, is that right? — Daniel Forgues 05:39, 19 December 2010 (UTC)
- Generally, yes. A quick search through stripped.gz shows a number that have 3, 2, or even just 1 term:
- 1 term: A058445, A058446, A072288, A076337, A082710, A115453, A118329, A122036, A144134
- 2 terms: A001220, A003847, A003854, A003936, A003937, A003943, A003944, A008869, A008870, A010332, A014127, A014136, A020329, A028446, A050920, A058433, A058434, A058453, A058454, A058471, A058472, A062595, A062626, A062638, A062644, A062651, A062659, A062663, A062665, A064117, A081208, A081357, A082813, A088164, A100351, A101571, A101734, A101846, A102910, A102997, A103479, A103504, A107646, A110018, A111027, A114432, A118019, A119333, A120377, A122421, A122557, A122650, A123155, A123693, A126432, A130682, A131960, A132642, A133858, A135240, A135442, A137599, A138763, A138790, A139410, A139775, A139777, A140171, A144587, A144588, A145276, A145277, A145744, A153433, A154110, A154998, A158664, A158750, A167842, A171266, A173377, A173418, A176024, A176935, A178329, A178812, A178900, A179128, A179144, A179161, A179172, A179173, A179174, A180247
- 3 terms: 370 sequences
- But 4 terms is usually the minimum.
- Charles R Greathouse IV 07:56, 5 February 2011 (UTC)
- If one term is enough, then I wonder whether I should submit the "sequence"
- Odd spoof perfect numbers: 198585576189 — Daniel Forgues 01:08, 6 February 2011 (UTC)
- The thing is, a search for 198585576189 gives more than one result. A search for 316912650057057350374175801344000001 gives only one result (the aforementioned A072288—or maybe that sequence should be changed to 1429, 1129, 29 or 53, 427169, 5501, 19, 59, 1327, 1645318771, 61, 211, 17, 1831 and have 316912650057057350374175801344000001 given in a comment). Alonso del Arte 01:23, 6 February 2011 (UTC)
Templates for references
I tried some time ago to get the the following Wikipedia templates
- Template:Citation/core, Template:Citation/core/doc,
- Template:Citation, Template:Citation/doc,
- Template:Cite arXiv, Template:Cite arXiv/doc,
- Template:Cite book, Template:Cite book/doc,
- Template:Cite journal, Template:Cite journal/doc,
to work within the OEIS, but they are dependent on so many other Wikipedia templates that it is not easy to disentangle from Wikipedia...
I will work some more on them (any help on those would be great too, although I'm almost done now) and if I don't succeed on disentangling those templates then I will have to start from scratch. Also, we would need to get approval from Neil Sloane and David Applegate before starting using them, in case they have other plans (there are many different referencing conventions.) — Daniel Forgues 02:20, 20 December 2010 (UTC)
Now, using the "Cite journal" template, as
{{Cite journal
| author = Hassani, Mehdi
| title = Derangements and Applications
| publisher = Journal of Integer Sequences (JIS), Volume 6, Issue 1, Article 03.1.2, 2003
| url = http://www.cs.uwaterloo.ca/journals/JIS/VOL6/Hassani/hassani5.html
}}
gives
- Hassani, Mehdi. Derangements and Applications. Journal of Integer Sequences (JIS), Volume 6, Issue 1, Article 03.1.2, 2003.
where I have to deal with the missing template (not missing anymore)
- Template:Citation/make link
and it is not quite yet working... — Daniel Forgues 03:16, 20 December 2010 (UTC)
- Almost working (only that spurious link at the end...) — Daniel Forgues 08:38, 20 December 2010 (UTC)
Wikipedia uses the "Cite web" template (so I'll bring that one into the OEIS (that's now done)) ("Cite journal" must be for traditional printed journals...)
{{Cite web
| author = Hassani, Mehdi
| title = Derangements and Applications
| publisher = Journal of Integer Sequences (JIS), Volume 6, Issue 1, Article 03.1.2, 2003
| url = http://www.cs.uwaterloo.ca/journals/JIS/VOL6/Hassani/hassani5.html
}}
which gives
- Hassani, Mehdi. "Derangements and Applications". Journal of Integer Sequences (JIS), Volume 6, Issue 1, Article 03.1.2, 2003.
and it will work (if I succeed...) once I bring it in the OEIS (which I'll do right now.) ... — Daniel Forgues 03:31, 20 December 2010 (UTC)
Almost working now (the title works as a link, have to get rid of link appearing at the end...) — Daniel Forgues 04:02, 20 December 2010 (UTC)
Trying the "Cite book" template, as
{{Cite book
| last = Mumford
| first = David
| authorlink = David Mumford
| title = The Red Book of Varieties and Schemes
| publisher = [[Springer-Verlag]]
| series = Lecture notes in mathematics 1358
| year = 1999
| doi = 10.1007/b62130
| isbn = 354063293X
}}
gives
- Mumford, David (1999). The Red Book of Varieties and Schemes. Lecture notes in mathematics 1358. Springer-Verlag. doi:10.1007/b62130. ISBN 354063293X.
almost works (but needs Template:Citation/identifier, one more dependent template needed, which I'll bring in... it's now done) — Daniel Forgues 04:11, 20 December 2010 (UTC)
- Cite book works properly now! — Daniel Forgues 08:38, 20 December 2010 (UTC)
Trying the "Cite arXiv" template, as
{{Cite arXiv
| last = Sparling
| first = George A.J.
| eprint = gr-qc/0610068
| title = Spacetime is spinorial; new dimensions are timelike
| year = 2006
| version = v1
}}
gives
- Sparling, George A.J. (2006). "Spacetime is spinorial; new dimensions are timelike". arΧiv:gr-qc/0610068v1.
which partially works (but needs 2 more templates... it's now done) — Daniel Forgues 04:18, 20 December 2010 (UTC)
- Cite arXiv works properly now! — Daniel Forgues 08:38, 20 December 2010 (UTC)
Trying the template "Citation", a generic citation template which tries to determine which specific Cite template to use from parameters used, as
{{Citation
| last = Turner
| first = O.
| title = History of the Pioneer Settlement of Phelps and Gorham's Purchase, and Morris' Reserve
| publisher = William Alling
| place = Rochester, New York
| year = 1851
| url = http://olivercowdery.com/texts/1851Trn1.htm#turn1851
}}
gives
- Turner, O. (1851), History of the Pioneer Settlement of Phelps and Gorham's Purchase, and Morris' Reserve, Rochester, New York: William Alling.
which almost works (except for that spurious link at the end...) — Daniel Forgues 04:33, 20 December 2010 (UTC)
Cite arXiv works properly now! — Daniel Forgues 08:38, 20 December 2010 (UTC)
Cite book works properly now! — Daniel Forgues 08:38, 20 December 2010 (UTC)
Trying "Cite journal", as
{{Cite journal
|first=W. Hugh
|last=Woodin
|title=The Continuum Hypothesis, Part I
|journal=Notices of the AMS
|volume=48
|issue=6
|year=2001
|pages=567–576
|location=Providence, RI
|publisher=American Mathematical Society
|url=http://www.ams.org/notices/200106/fea-woodin.pdf
|format=PDF
|issn=1088-9477
|oclc=34550461
}}
gives
- Woodin, W. Hugh (2001). "The Continuum Hypothesis, Part I" (PDF). Notices of the AMS (Providence, RI: American Mathematical Society) 48 (6): 567–576. ISSN 1088-9477. OCLC 34550461.
almost works right (still that spurious link at the end...) — Daniel Forgues 09:55, 20 December 2010 (UTC)
- Anybody got a clue why the html link keeps appearing at the end (they don't in Wikipedia...) — Daniel Forgues 10:06, 20 December 2010 (UTC)
Check the following page for usage testing of reference templates:
All the tentative reference templates (obtained from Wikipedia, we need approval from Neil Sloane and David Applegate before using them, in case they want to use a different standard for references)
- Template:Cite book
- Template:Cite journal (Template:Cite paper as redirect)
- Template:Cite magazine (Template:Cite magazine article as redirect)
- Template:Cite web
- Template:Cite arXiv
- Template:Citation (a generic reference template trying to choose the right specific template from parameters used)
work properly if you don't use a URL. If you use a URL, it gets wrapped properly in a link with title as label, but it also appears unwrapped at the end of the line (and it shouldn't, it doesn't in Wikipedia.) This I (or someone else...) still have to fix, but I will need strong coffee to delve into the Template:Citation/core template... which as you guess implements the core functionality shared by all the citation templates. — Daniel Forgues 06:08, 25 December 2010 (UTC)
MathWorld template
The MathWorld template may be modified to get (which I actually do like more)
- Eric W. Weisstein, "Derangement," from MathWorld – A Wolfram Web Resource
instead of the current
- Weisstein, Eric W., Derangement, from MathWorld—A Wolfram Web Resource. [http://mathworld.wolfram.com/Derangement.html]
— Daniel Forgues 07:17, 20 December 2010 (UTC)
Form of recursion formulae
IMO a Style Sheet entry giving advice concerning the form of recursion formulae is urgently needed. Klaus Brockhaus 20:50, 21 December 2010 (UTC)
- Base conditions, boundary conditions, recursion equation. In that order, order matters. Example:
For 0 <= n, 0 <= k <= n. T(0,0) = 1; T(n,0) = T(n-1,n-1) if n > 1; T(n,k) = T(n-1,k-1) + T(n,k-1) otherwise. Terser, and more computational: T = (n,k) -> if n = 0 then 1 elif k = 0 then T(n-1,n-1) else T(n-1,k-1) + T(n,k-1).
Continued:
Thus we can state this recursion in one sentence as: The value of T(n,k) is, if n = 0 then 1 else if k = 0 then T(n-1,n-1) else T(n-1,k-1) + T(n,k-1).
A recursion can be thought of as a logical cascade, an ordered list of pairs [[cond_1,val_1],...,[cond_n,val_n]] which is evaluated from left to right. In our example this can be written symbolically as:
- T(n,k) = Recursion([[n = 0, 1], [k = 0, T(n-1,n-1)], [true, T(n-1,k-1) + T(n,k-1)]]).
This form might be regarded as a terse 'style' to state a recursion. It can be copied and pasted into a CAS like Maple; only minor syntactic adjustments are necessary.
T := proc(n,k) local rec; rec := '[[n=0,1],[k=0,T(n-1,n-1)],[true,T(n-1,k-1)+T(n,k-1)]]': Recursion(T,rec,n,k) end:
for n from 0 to 4 do seq(T(n,k),k=0..n) od;
1
1, 2
2, 3, 5
5, 7, 10, 15
15, 20, 27, 37, 52
Clearly also recursions on one parameter work this way:
Fact := proc(n) local Q; Q := '[[n<1,1],[1<=n,n*Fact(n-1)]]': Recursion(Fact,Q,n,notdef) end: Fact(4); 24
It is a pity that the developers of Maple forgot those four lines of code which make all this run. So now here they are:
Recursion := proc(U,Q,n,k) local i,S,Rec; Rec := proc(U,Q,n,k) local i; i := 1; while not evalb(op(1,Q[i])) do i := i+1 od: eval(op(2,Q[i])) end: Rec(U,Q,n,k) end:
— Peter Luschny 01:12, 22 December 2010 (UTC) —— Peter Luschny 18:03, 22 December 2010 (UTC)
"Authorship" and "Cite this page as" sections at end of all OEIS Wiki pages
Neil Sloane sent me the following email (Feb 1, 2011) regarding "Authorship" and "Cite this page as" sections at end of all OEIS Wiki pages
I do have one important comment, which applies to all the wiki pages. It seems to me that since we are a scientific database, pages should always say who the author is. Perhaps add two sections towards the end that say something like this: Authorship ========== The first version of this page was written by ...., Dec 45, 1893 Figures were provided by ... John Smith added the generating functions on Dec ... Further remarks added by ... etc Cite this page as ================= Daniel Forgues and others, <a href="http://oeis.org/wiki/Centered_polygonal_numbers">Centered polygonal numbers</a>, a page in the OEIS Wiki. (or something like that) It is true that one might be able to reconstruct the authorship information from the History tab, but it is pretty difficult to do so and will get more difficult as time goes on. I think all our web pages should have sections like this. Best regards Neil
— Daniel Forgues 05:46, 2 February 2011 (UTC)
What about splitting the article page in two: one for OEIS, one for OEIS Wiki
and
The issue in doing so is that we cannot simply do a move, it would have to be via copy and paste, and the edit history would be lost, so I won't do it myself.
— Daniel Forgues 16:32, 2 June 2011 (UTC)
Function names
The Guide to Spelling and Notation covers many cases like prime(n), p(n), cos(x). One that just came up in a sequence: Do we write moebius, mobius, möbius, Moebius, MoebiusMu, mu, μ, 𝜇, ...? I tend to use mu but it's probably best to standardize this.
Charles R Greathouse IV 19:03, 10 July 2011 (UTC)
- For what it's worth, I'd prefer Möbius mu across the board. However, for now maybe we should compromise to Moebius mu in OEIS Main and Möbius μ in the OEIS Wiki. (Mathematica programs of course keep MoebiusMu). Alonso del Arte 21:04, 10 July 2011 (UTC)
- I certainly prefer Möbius to its other spellings (of course outside of contexts like Mathematica and GP where spelling must be MoebiusMu and moebius), but the main question here is how to handle the sequences since the Style Sheet is still recommending against non-ASCII characters. Moebius mu (when referring to it) and mu(n) (when used as a function) are probably best in that context. Charles R Greathouse IV 22:03, 5 September 2011 (UTC)
Operations over ranges
Motivated by a recent pink box discussion: What is the best way to write the expressions below?
(A----------------------------------)
Min(term(k) : start<=k<=end)
Max(term(k) : start<=k<=end)
Sum(term(k) : start<=k<=end)
Product(term(k) : start<=k<=end)
Integral(term(x) : start<=x<=end)
(B----------------------------------)
min(k=start..end, term(k) )
max(k=start..end, term(k) )
sum(k=start..end, term(k) )
product(k=start..end, term(k) )
integral(x=start..end, term(x) )
(C----------------------------------)
min_{k=start..end} term(k)
max_{k=start..end} term(k)
sum_{k=start..end} term(k)
product_{k=start..end} term(k)
integral_{x=start..end} term(x)
Guiding principle: The notation should follow as close as possible to the standard mathematical practice.
(1) Clearly min and max and not Min and Max is mathematical standard; thus (B) and (C) is to be preferred over (A).
(2) The range of application and the index of operation is bounded to the operation symbol; therefore again (B) and (C) is to be preferred over (A).
(3) I prefer (C) over (B) as it is again closer to the mathematical way of writing. It links the range to the operation by writing op_{..}; this way it is also done with TeX.
Moreover it emphasizes that a sum is not an operation with two variables (ranges and functions) but an operator acting on functions; this I believe is more natural. Peter Luschny 09:50, 15 September 2011 (UTC)
- There are many other ways I've seen in the OEIS, perhaps most prominent (of those missing) being
(B1---------------------------------) sum(k=start, end, term(k)) etc.
- I don't have strong preferences here, but I would prefer a unified standard. I think (B) and (C) are probably my favorites as they re-uses the range operator already used for b-files, giving the encyclopedia a more consistent feel. I suppose I prefer (B) slightly because of the lack of delimiters on the main term of (C).
- I concur with Peter on the case (sum not Sum) and feel obliged to point out that parentheses/round brackets, not brackets/hard brackets, should be used.
- Disclosure: I write LaTeX which uses (C) and GP which uses (B1).
- Charles R Greathouse IV 19:53, 15 September 2011 (UTC)
It was not my intention to list all variants seen in the OEIS. Rather I believe it is important to formulate a guiding principle which goes beyond the specific example here: "The notation should follow as close as possible to the standard mathematical practice." B1: sum(k=start, end, term(k)) is just another example of the way programming languages and styles become more and more predominant in the OEIS; a shift which I attribute more to some editors then to the authors or users. Peter Luschny 12:07, 16 September 2011 (UTC)
I'd vote for (2) [sic., (B) I think] because of machine-parsing. Also the following should be listed:
sum(k>=0, f(k) ) sum(k>=1, f(k) )
with >= preferred over >.
Joerg Arndt via Charles R Greathouse IV 13:11, 16 September 2011 (UTC)
- I'd vote against (B) (and of course even more against (A)!), at least w.r.t. min & max; here's why: 1°, the basic mathematical definition is: max {...}, namely the maximal element of a set S={...}; any other usage of "max" is a deformation of that basic definition (as explained in the sequel). 2°, in this context, the set will be given less often by selection, viz S = { x in U | P(x) } (read: "the [set of all] x in [the universe] U such that [property] P(x) is verified"), but more often by enumeration: S = { x1, x2, x3, ... } = { xi ; i=1,2,3... } = { x(i) ; i ∈ N } (read: "the set of all x(i), where i runs over all elements of the indexing set N"). It is seen that (esp. infinite) enumeration is the same as taking the image of a map (the sequence). That's where, "by abuse of notation", the habit of writing "max_{x in U} f(x)" comes from. Thus, even though this is an abuse of notation, it is still somehow related to its mathematical origin. This is not true for max(x=1..N, f(x)) - which is an artefact of (usually a very inefficient way of) computation of that maximum.
- When it comes to computation of a finite sum or product, the notation sum(i=1..n, x_i) seems very close to the mathematical notation and definition sum_{i=1..n} x_i, and as such "admissible" and at the same time often more convenient than the latter. But in this case I'd also agree with sum(x(i), i=1..n), which still is close to the previous notation, and somewhere in between that and the "enumerative" {x(i) ; i=1,2,3,...}.
- Summarizing, the answer is different for min/max which definitely operate in their most basic definition on sets, while (esp. infinite) sum/prod necessarily operate on sequences (= functions, of the index) and definitely do not operate on sets in their most basic definition. — M. F. Hasler 03:26, 26 November 2012 (UTC)
Function names: LCM and GCD
- Write lcm in formulas (not LCM)
- Write gcd in formulas (not GCD)
For example on Wikipedia all occurences of lcm and gcd in formulas are written with lower case letters. (See links below.)
Upper-case letters (LCM and GCD) are only used as an abbreviation in the text.
- For example, the GCD of 8 and 12 is 4.
- gcd(8,12) = 4.
Another example: A199806 Alternating LCM-sum: a(n)=sum_{k=1..n} (-1)^(k-1)*lcm(k,n).
And not, as it is: A199806 Alternating LCM-sum: a(n)=sum_{k=1..n} (-1)^(k-1)*LCM(k,n).
Wikipedia LCM Wikipedia GCD — Peter Luschny 23:47, 10 November 2011 (UTC)
Any guidance on GCD as opposed to gcd? The former seems to be more prevalent in the OEIS. (This of course is irrelevant for computer programs—Mathematica requires the former and PARI apparently the latter). Alonso del Arte 20:24, 16 September 2012 (UTC)
See the first table on this mathworld page: Graham, Knuth, and Patashnik, Concrete Mathematics, as well as Bressoud and Wagon, Course in Computational Number Theory, as well as Bronshtein, Semendyayev, Musiol, and Muehlig, Handbook of Mathematics, use gcd. This settles this question for me. Peter Luschny 16:22, 17 September 2012 (UTC)
- If no one has any objections, I'll go ahead and put your proposals into the Style Sheet. Alonso del Arte 17:51, 17 September 2012 (UTC)
- I happily agree! Thanks for the help in defending traditional mathematical notation! — M. F. Hasler 02:50, 26 November 2012 (UTC)
