Wikipedia:Reference desk/Archives/Mathematics/2020 October 21

= October 21 =

Primes of the form kn^2 - kn + 1
Has anyone ever made any conjectures related to this statement:

The sequences of the form $$ kn^2 - kn + 1 $$ produce infinitely many primes for all $$ k <> 4 $$. (For $$ k=4 $$, the sequence is simply the odd squares.) Georgia guy (talk) 13:52, 21 October 2020 (UTC)


 * The formula is somewhat reminiscent of the Lucky numbers of Euler. CodeTalker (talk) 18:34, 21 October 2020 (UTC)


 * This seems to be a special case of the Bunyakovsky conjecture, which in turn is a generalization of Landau's fourth problem. The numbers themselves are (in most cases) Centered polygonal numbers. (I'm not entirely convinced that article meets WP's notability criteria but I've used up my orange tag quota for the month.) For fixed k there are certain things you can say about the possible prime factors of these numbers, for example if a prime divides n^2 - n + 1 then it must be 3 or congruent to 1 mod 3. This, in turn affects the "probability" that a number of this form will be prime, and from there you can make an educated guess at the frequency of such primes. But that's a long way from a proof and in general problems like this are usually either relatively easy or completely intractable, with Dirichlet's theorem on arithmetic progressions being one of the few cases that lie in the middle somewhere. --RDBury (talk) 20:07, 21 October 2020 (UTC)

Calculating the value of arctan2(x, y)
Our article atan2 states that the function can be calculated as follows:


 * $$\operatorname{atan2}(y, x) =

\begin{cases} \arctan(\frac y x) &\text{if } x > 0, \\ \arctan(\frac y x) + \pi &\text{if } x < 0 \text{ and } y \ge 0, \\ \arctan(\frac y x) - \pi &\text{if } x < 0 \text{ and } y < 0, \\ +\frac{\pi}{2} &\text{if } x = 0 \text{ and } y > 0, \\ -\frac{\pi}{2} &\text{if } x = 0 \text{ and } y < 0, \\ \text{undefined} &\text{if } x = 0 \text{ and } y = 0. \end{cases}$$

I'm new to polar coordinates and I'm not that familiar with how they work. When x < 0, why should the definition distinguish between positive and negative values of y? For any angle in radians, adding or subtracting pi should have the same effect. At least, that's my impression from high school math. Why should that not apply here? -- Puzzledvegetable Is it teatime already?  17:39, 21 October 2020 (UTC)


 * I'm not really sure what you're asking, but essentially because atan2 is defined that way. You could define an atan3 that returns a value in the range $$[0,2\pi),$$ but you'd still be distinguishing between cases no matter what you pick. –Deacon Vorbis (carbon &bull; videos) 17:51, 21 October 2020 (UTC)
 * My question is why atan2 is defined that way. My somewhat unsophisticated understanding of angles is that adding pi to an angle, and subtracting pi from the same angle, should have the same result. Pi takes you halfway around the circle, regardless of which "direction" you take. So, why distinguish between positive and negative values of y if we're doing the same thing anyway? -- Puzzledvegetable Is it teatime already?  18:12, 21 October 2020 (UTC) + minor edit -- Puzzledvegetable  Is it teatime already?  18:14, 21 October 2020 (UTC)
 * I mean, $$\pi/2$$ and $$5\pi/2$$ represent the same angle in the plane, but they're still two different numbers. You have to pick  half-open interval of length $$2\pi$$ to return values in.  If you mean, why this particular choice?  I'm just guessing a bit, but probably because it's centered around 0, just like the regular arctangent.  As far as which endpoint to include...ehh, I guess one favors the positive choice? It doesn't really make much difference.  But you have to pick  and stick with it.  –Deacon Vorbis (carbon &bull; videos) 18:24, 21 October 2020 (UTC)
 * To add a little to that, if, for example, you used $$\arctan(y/x) + \pi$$ for both cases when $$x < 0,$$ as you seem to be hinting at, then you'd get something in the range $$(-\pi/2,3\pi/2).$$ You'd still have to decide which endpoint to include. This would also be a valid definition, but it's probably a less natural one due to the lack of symmetry. –Deacon Vorbis (carbon &bull; videos) 18:29, 21 October 2020 (UTC)
 * That makes sense, but shouldn't it be the opposite? When y is negative, using arctan rather than atan2 would result in a point that is in quadrant I. To compensate for this, you should need to add pi to the angle to get it back to quadrant III. When y is positive using arctan rather than atan2 would result in a point that is in quadrant IV. To compensate for this, you should need to subtract pi to get it back to quadrant II. Yet, the definition seems to say the opposite. I thought that angles increase in a counter-clockwise direction. -- Puzzledvegetable Is it teatime already?  18:43, 21 October 2020 (UTC)


 * A more indirect way of defining $$\mathrm{atan2}$$ mathematically (ignoring the fact that computations with floating point numbers cannot be always exact) is as follows:
 * For $$r>0$$ and $$\varphi\in(-\pi,\pi]$$, $$~\mathrm{atan2}(r\sin\varphi,r\cos\varphi)=\varphi.$$
 * For a relationship of this kind to hold, $$r$$ needs to be constrained either to be positive or to be negative; few people will contest that $$r>0$$ is the better choice. For $$\varphi$$ we need a constraint of either the form $$\varphi\in(\alpha-2\pi,\alpha]$$ or $$\varphi\in[\alpha,\alpha+2\pi)$$ for some fixed $$\alpha.$$ The choice $$\varphi\in[0,2\pi)$$ would have been reasonable, but probably the desire to have the identity $$\mathrm{atan2}(y,1)=\arctan y$$ be valid led to the choice we have now. --Lambiam 21:08, 21 October 2020 (UTC)