Wikipedia:Reference desk/Archives/Mathematics/2025 February 17

Mathematics desk
< February 16 << Jan | February | Mar >> Current desk >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


February 17

edit

Infinitely many pairs of consecutive primes with given last digits

edit

For which pairs   is it known that there are infinitely many primes ending with the digit d1 for which the next prime ends with the digit d2? Note that there are 16 possible pairs to consider.

If one arranges the 16 sets of pairs of consecutive primes into a  -grid, then it is easy to see that at least one set in each row and one in each column must be infinite (by Dirichlet's theorem on arithmetic progressions). Perhaps, all 16 sets might turn out to be infinite.

More generally, the problem could be generalized to bases other than 10. In this case, for base b, there are φ(b)2 possible combinations for the mod-b remainders (or equivalently, the last digits in base b) of pairs of consecutive primes greater than the largest prime dividing b, where φ(b) is Euler's totient function. Another possible generalization would be to consider triplets or n-tuples of consecutive primes. In this case, there are φ(b)n possible combinations for the mod-b remainders (or equivalently, the last digits in base b) of n-tuples of consecutive primes greater than the largest prime dividing b. The corresponding conjecture would then be that all of the resulting φ(b)n sets of n-tuples of consecutive primes are infinite. GTrang (talk) 05:27, 17 February 2025 (UTC)[reply]

For what it's worth, solving b=5 would also solve b=10 since all primes after 2 are odd. It seems reasonable to expect that 16 entries in the grid to be infinite; primes seem to behave randomly in every way they might be expected to behave randomly, but proving the corresponding conjectures usually proves elusive. Dirichlet's theorem is an example of this, since even though the behavior in question is very simple, the proof is very complex. The case b=2 is trivial, but other than that I think a more realistic question is if there has been any research or partial results on the question. --RDBury (talk) 08:44, 17 February 2025 (UTC)[reply]
PS. For b=4 it's not hard to see that Dirichlet's theorem implies the (1, 3) and (3, 1) entries must be infinite. Otherwise there would be a point after which the last digits would be all 1 or all 3. It's not hard to find data on-line, for example here for b=10 and here for b=4. I imported the b=4 data into a spreadsheet and found the entries in the grid for the first 10000 primes. The results were (1, 1):2053, (1, 3):2930, (3, 1):2931, (3, 3):2084. As you can see the (1, 3) and (3, 1) entries are significantly larger than the (1, 1) and (3, 3), and from what I can tell this doesn't seem to a transient effect; when you restrict the range to 9000 to 10000 the imbalance doesn't go away. I have no explanation for this. A similar experiment with the entries in the b=10 grid also appear to be significantly imbalanced. --RDBury (talk) 09:30, 17 February 2025 (UTC)[reply]
A (1, 3) pair can be twins (e.g. 11 – 13 or 4241 – 4243) and a (3, 1) pair can be just 8 apart (e.g. 683 – 691 or 8753 – 8581), whereas (1, 1) and (3, 3) require a prime gap that is at least 10. In the beginning of the sequence of prime gaps (OEIS A001223) larger gaps are relatively rare. Around 10000 the average gap is about log(10000) ≈ 9.2, but the imbalance may eventually disappear when the average gap is substantially larger than 10.  ‑‑Lambiam 11:02, 17 February 2025 (UTC)[reply]
Right. I was thinking b = 4, so to me a (1, 3) pair would be 17, 19. If the "probably" of a number being prime is p, then the "probability" of a (1, 3) or (3, 1) pair is p + (1-p)2p + (1-p)4p ... = p/(1-(1-p)2). = p/(2p-p2) = 1/(2-p). Similarly, the "probability" of a (1, 1) or (3, 3) pair is (1-p)/(2-p). These do converge to 1/2 as p→0, but seeing as p is roughly inversely proportional to the number of digits (by the prime number theorem), the convergence will be very slow and the difference will still be noticeable even going up to the 10000th prime (6 digits). It would be interesting to compare different ranges of primes to see if the amount of imbalance actually matches what the prime number theorem predicts, but I'm satisfied for now. --RDBury (talk) 15:23, 17 February 2025 (UTC)[reply]
For which quadruples   there are infinitely many primes beginning with the digit d1 and ending with the digit d2 for which the next prime begins with the digit d3 and ends with the digit d4? 49.217.57.194 (talk) 18:52, 19 February 2025 (UTC)[reply]
I think we have no theory that helps to settle positive statements of this nature. I believe, nevertheless, that there are infinitely many such pairs when   and otherwise probably none at all. This is based on a heuristic using the average density given by the prime number theorem, but some cases can be definitely excluded by Bertrand's postulate (which in spite of the name is a theorem). Others are excluded by Cramér's conjecture, which however has not been proved.  ‑‑Lambiam 20:40, 19 February 2025 (UTC)[reply]

Leibniz rule for antiderivatives

edit

The general Leibniz rule is a formula for computing higher derivatives of products:

 

This is analogous to the binomial theorem, and in fact, as pointed out in the article, the binomial theorem can be proven from the special case f=exp(ax), g=exp(bx). But the binomial theorem can be generalized to negative n using the binomial series. So it seems reasonable (at least to me) to generalize the Leibniz rule to find a formula for (fg)(n) when n is negative, where f(-k) is interpreted to mean a kth antiderivative of f. An antiderivative is only defined up to a constant, but this can resolved by stipulating, say, f(-k)(0) = 0. For example, we have:

 

when the series converges; this is iterated integration by parts. (Note that if g is polynomial then the sum is finite and convergence is not an issue.) Similarly:

 

and more generally:

 

This seems relatively straightforward to prove, given sufficient hand-waving on convergence and arbitrary constants, and useful since I happened to need a formula for (xi exp(x))(-k), so it seems like this is the kind of thing that would be well known and documented. But my searches have not turned up anything; I get a lot of results for the Leibniz integral rule instead, and that's very different. So do these formulas look familiar to anyone? --RDBury (talk) 10:54, 17 February 2025 (UTC)[reply]

Here integration by parts is called "the nearest possible approach to a general theorem for finding the antiderivative of the product of two functions". So your Leibniz-rule generalization would apparently be a surprise to the author.  ‑‑Lambiam 20:55, 19 February 2025 (UTC)[reply]
Thanks. The first formula is implied by the information given in Integration by parts#Repeated integration by parts. That section doesn't have citations, though that can be forgiven if the information is "common knowledge". But I'm not sure that the first formula would count as a more "general theorem". --RDBury (talk) 14:01, 20 February 2025 (UTC)[reply]
Doesnt the formula for   follow by applying the formula for   to the terms in the formula for  ?  ‑‑Lambiam 19:35, 20 February 2025 (UTC)[reply]
Yes. Like I said, the formula is straightforward to prove. I was just saying that given that, and that it's a time saver in certain circumstances, it's odd that it doesn't seem to be well known. In fact I kind of expected to be in Wikipedia. RDBury (talk) 21:22, 20 February 2025 (UTC)[reply]