Showing posts with label triangular numbers. Show all posts
Showing posts with label triangular numbers. Show all posts

Thursday, 11 September 2025

Even Numbers as Sums of Three Pronic Numbers

I saw this problem mentioned in a post on math.stackexchange.com:

See if you can prove that every even number is the sum of three pronic numbers (if needed, we say 0 is also pronic) 

I put the problem to Gemini and got the response that "it's impossible to prove that every even number is the sum of three pronic numbers". I wasn't convinced so I consulted Grok. Here was its response.

Every even non-negative integer can indeed be expressed as the sum of three pronic numbers, where pronic numbers are of the form \(n(n+1)\) for non-negative integers \(n \geq 0\) (thus including 0 as the pronic number for \(n=0\)).

To prove this, first recall that a pronic number \(p_n = n(n+1) = 2 \cdot T_n\), where \(T_n = \frac{n(n+1)}{2}\) is the \(n\)th triangular number (with \(T_0 = 0\)). Let \(E\) be an arbitrary even non-negative integer, so \(E = 2m\) for some non-negative integer \(m\). The claim is equivalent to showing that every non-negative integer \(m\) can be written as the sum of three triangular numbers: \(m = T_a + T_b + T_c\) for some non-negative integers \(a, b, c\). This is a known theorem (attributed to Gauss): every non-negative integer is the sum of at most three triangular numbers. The proof relies on a connection to the three squares theorem and modular arithmetic, as follows. Step 1: Relate triangular numbers to squares.
Observe that \(8T_n + 1 = (2n + 1)^2\). Thus, every number of the form \(8T_n + 1\) is an odd perfect square, and conversely, every odd perfect square is of this form for some \(n\). Step 2: Reformulate the problem.

Suppose \(m = T_a + T_b + T_c\). Multiplying by 8 and adding 3 gives:$$ \begin{align} 8m + 3 &= (8T_a + 1) + (8T_b + 1) + (8T_c + 1) \\ &= (2a + 1)^2 + (2b + 1)^2 + (2c + 1)^2 \end{align} $$so \(8m + 3\) is the sum of three odd squares. The converse also holds: if \(8m + 3\) is the sum of three odd squares, then \(m\) is the sum of three triangular numbers.
Thus, it suffices to show that every number of the form \(8m + 3\) (for \(m \geq 0\)) is the sum of three odd squares. Step 3: Use the three squares theorem
Legendre's three squares theorem states that a positive integer can be expressed as the sum of three squares if and only if it is not of the form \(4^k(8l + 7)\) for non-negative integers \(k, l\). Numbers of the form \(8m + 3\) are congruent to 3 modulo 8. Check if such numbers can be of the forbidden form \(4^k(8l + 7)\):
  • For \(k = 0\): \(8l + 7 \equiv 7 \pmod{8}\), not 3.
  • For \(k = 1\): \(4(8l + 7) = 32l + 28 \equiv 4 \pmod{8}\), not 3.
  • For \(k \geq 2\): \(4^k(8l + 7) \equiv 0 \pmod{8}\), not 3.
Since \(8m + 3\) is never of the forbidden form, every such number is the sum of three squares.

Step 4: Ensure the squares are odd
It remains to show these three squares must be odd. Consider sums of three squares modulo 8. Perfect squares modulo 8 are 0, 1, or 4:
  • Odd squares: \(\equiv 1 \pmod{8} \)
  • Even squares: \( \equiv 0 or 4 \pmod{8} \)
The possible sums modulo 8 are 0, 1, 2, 3, 4, 5, or 6 (never 7). Specifically for \(\equiv 3 \pmod{8} \)
  • Three odd squares: \(1 + 1 + 1 = 3\)
  • Two odd, one even: \(1 + 1 + 0 = 2\) or \(1 + 1 + 4 = 6\).
  • One odd, two even: \(1 + 0 + 0 = 1, 1 + 0 + 4 = 5\), or \(1 + 4 + 4 = 9 \equiv 1\).
  • Three even: \(0 + 0 + 0 = 0, 0 + 0 + 4 = 4\), \( 0 + 4 + 4 = 8 \equiv 0\), or \(4 + 4 + 4 = 12 \equiv 4\).
The only combination yielding \(3 \pmod{8} \) is three odd squares. Therefore, since every \(8m + 3\) is the sum of three squares and \(\equiv 3 \pmod{8}\), it must be the sum of three odd squares. This completes the proof. For any even \(E = 2m\), express \(m = T_a + T_b + T_c\), then$$ \begin{align} E &= 2T_a + 2T_b + 2T_c \\ &= p_a + p_b + p_c \end{align} $$where each \(p_i \) is pronic.

This is a nice straightforward proof. I've written about pronic numbers before in posts titled:

Friday, 27 March 2020

Selfie Numbers

Today, I turned 25926 days old and was surprised to discover that this is a so-called selfie number. The article in which I discovered this fact began with this abstract which explains what is meant by the term:
Numbers represented by their own digits by certain operations are considered as selfie numbers. Some times they are called wild narcissistic numbers. There are many ways of representing selfie numbers. They can be represented in digit’s order, reverse order of digits, increasing and/or decreasing order of digits, etc. These can be obtained by use of basis operations along with factorial, squareroot, Fibonacci sequence, Triangular numbers, binomial coefficients, s-gonal values, centered polygonal numbers, etc. In this work, we have written selfie numbers by use of concatenation, along with factorial and square-root. The concatenation idea is used in a very simple way. The work is limited up to 5 digits. Work on higher digits shall be dealt elsewhere. Source.
I discovered that 25926 could be expressed as \((−2+5)!! \times C(9,2)+6\). This immediately caused me confusion because I'm use to treating !! as the double factorial in which case we have:$$(-2+5)!!=3!!=3 \times 1 = 3$$However, this produces \(3 \times 36 +6=124\) and so something is wrong. After typing 3!! into a Google search, I saw what was meant (see Figure 1):

Figure 1

So instead of 3!!=3, we have (3!)!=6!=720 and now \(720 \times 36+6\) does give 25926.

The title of the previously mentioned article is:

Concatenation-Type Selfie Numbers
With Factorial and Square-Root


The author of the article, Inder J. Taneja1, categorises the selfie numbers into the following types:

1 Crazy Representations

1.1 Selfie Numbers

2 Concatenation-Type Selfie Numbers

2.1 Sequential Representations
2.1.1 Both Ways
2.1.2 Digit’s Order
2.1.3 Reverse Order of Digits
2.2 Non Sequential Representations
2.2.1 Both Ways
2.2.2 Digit’s Order
2.2.3 Reverse Order of Digits

3 Number Patterns

4 Summary: Selfie Numbers

4.1 Factorial
4.2 Factorial and Square-Root
4.3 Fibonacci Sequence
4.4 Triangular Numbers
4.5 Binomial Coefficients
4.6 S-gonal numbers
4.7 Centered Polygonal Numbers
The author has written a previous paper (it is 161 pages in length) that begins with the following abstract:
Natural numbers from 0 to 11111 are written in terms of 1 to 9 in two different ways. The first one in increasing order of 1 to 9, and the second one in decreasing order. This is done by using the operations of addition, multiplication, subtraction, potentiation, and division. In both the situations there are no missing numbers, except one, i.e., 10958 in the increasing case.
The decreasing case can be written as 10958 = (9 + 8 × 7 × 65 + 4) × 3 − 2 + 1. However, if factorials and square roots are allowed, then more than one representation of the increasing case is possible. Here are two examples:$$10958 := 1+2+3!!+(−4+5!+6−7)×89$$ $$10958 := 1×2×(3!!−4!×(5+6)+7!−8−9)$$The author uses factorials and square roots, as well as additional elements, for his selfie numbers. One of those additional elements is concatenation defined as:$$a \parallel b := 10 \times a + b, a \in \mathbb{Z}, b \in \{ 0, 1, 2, 3, 4, 6, 7, 8, 9 \}$$At first I was confused by the := symbol but I discovered its significance:
It is borrowed from computer programming: it means that the item on the left hand side is being defined to be what is on the right hand side. For example, \(𝑦:=7𝑥+2\) means that \(𝑦\) is defined to be \(7𝑥+2\). This is different from, say, writing \(1=\sin^2 \theta +\cos^2 \theta \). Source.
As an example of its use we have:$$ 2 \parallel 3 := 2 \times 10 + 3 = 23$$$$5 \parallel 15 := 5 × 100 + 15 = 515$$$$ ((3 \times 3) \parallel 1)^2 \times 4:=91^2 \times 4 = 33124$$It is possible to reverse the order of the digits as in the following example:$$39304 := ((4 \parallel 03) − 9) ^3$$Sometimes numbers can be written sequentially both forwards and backwards as in the following example where the square root and factorial are used in addition to concatenation:$$30969 := ((3 + 0!) \parallel \sqrt{9}) \times 6! + 9 = 9 + 6! × ((\sqrt{9}+0!)\parallel 3)$$The author also makes use of the Fibonacci sequence defined as:$$ F(0) = 0, F(1) = 1, F(n + 1) = F(n) + F(n − 1), n ≥ 1$$Below is an example of a selfie number that makes use of the Fibonacci sequence values:$$834660 := (F(8 × 3) × F(4) + 6) × 6 + 0 = 0 + 6 × (6 + F(4) × F(3 × 8))$$The triangular numbers are also used and the general formula for these is:$$T(n) = 1 + 2 + 3 + ... = \frac{n + 1} {2} = C(n + 1, 2)$$Here is an example of a selfie number that makes use of Triangular numbers:$$99633 := 3 + (3 + T(T(6) + T(9))) × T(9)$$As we saw with the example of my daily number, binomial coefficients can be used as well as S-gonal numbers, defined by the following formula:$$P(n, s) := \frac{n \,(n − 1) \, (s − 2) }{2} + n, s > 2$$Here is an example of a selfie number that makes use of S-gonal numbers:$$53995 := (5! − P(9, \sqrt{9})) × 3!! − 5$$Lastly, the author makes use of centered polygonal numbers defined by the formula:$$K(n,t) := \frac{t \, n \, (n − 1)}{ 2} + 1, t > 2$$An example of a selfie number using such numbers is:$$59938 := K(8, 3!) + (\sqrt{9})!! + 9^5 $$There are plenty of examples in the aforementioned paper and, though the arithmetic involved is simply enough once it's displayed, one has to often marvel at the ingenuity required to create the elements in the first place.

Selfie numbers are similar to Friedman numbers except that in the latter the digits can be in any order. A number \(n\)  is a Friedman number if it can be obtained combining all its digits with the 5 arithmetic operations and concatenation (of digits, not of results). For example, 13125 is a Friedman number since it can be written as \(21\times 5^{3+1}\). An impressive example is the pandigital number 9108432576 that can be written as \(251^3 \times 4 \times 6 \times(7 + 8 + 9 + 0) \).

Thursday, 20 December 2018

A Prime to Remember

Primes come and go but lately, as I keep a daily track of the number of my diurnal days, there has been more than usual. To illustrate, days 25447, 25453, 25457, 25463, 25469, and 25471 are all primes in a 6-4-6-6-2 pattern. After 25471 there will quite a drought because the next prime is 25523, a gap of 32.

Today I'm 25463 days old and I can't let it pass without recording some of its more interesting properties. One of these is that it is a member of OEIS A165572: the greater prime factor of successively better Golden Semiprimes. These semiprimes p*q, starting from 6=2*3, have the property that each successive value of q/p gives a better approximation of the Golden Ratio than the previous term where the $$ \text{Golden Ratio } \phi=\frac{1+\sqrt(5)}{2} \approx \, 1.61803398874989$$Here are the initial members of this sequence: 3, 5, 11, 31, 37, 47, 157, 571, 911, 1021, 1487, 2351, 3571, 24709, 25463. The corresponding semiprimes form OEIS A165570 and consist of 6, 15, 77, 589, 851, 1363, 15229, 201563, 512893, 644251, 1366553, 3416003, 7881197, 377331139, 400711231, 2963563859, 4035221017.

Here are the progressively better approximations as the larger factor of the semiprime is divided by the smaller:

3/2         1.50000000000000
        5/3         1.66666666666667
        11/7         1.57142857142857
    31/19         1.63157894736842
      37/23         1.60869565217391
     47/29         1.62068965517241
157/97         1.61855670103093
  571/353         1.61756373937677
    911/563         1.61811722912966
1021/631         1.61806656101426
1487/919         1.61806311207835
 2351/1453         1.61803165863730
  3571/2207         1.61803352967830
 24709/15271         1.61803418243730
25463/15737         1.61803393276991

Another property of 25463, albeit a base dependent one, is its membership in OEIS A156119: primes formed by rearranging five consecutive decimal digits (avoiding leading 0). No primes can be formed from {1,2,3,4,5} or {4,5,6,7,8} since they are divisible by three. Sequence is finite, ending with a(52)=96857. Initial members of sequence are: 10243, 12043, 20143, 20341, 20431, 23041, 24103, 25463.

Yet another property, again base dependent, is its membership of OEIS A124629: primes p such that their cubes are pandigital, meaning all digits from 0 to 9 must appear at least once; here 25463^3=16509301927847. The initial members of this sequence are: 5437, 6221, 7219, 8443, 10903, 11353, 15937, 17123, 18229, 19429, 20353, 20903, 20929, 21803, 21841, 21961, 22123, 22283, 22993, 23053, 23369, 23663, 24733, 25183, 25219, 25463.

Not base dependent is the property that 25463 shares as a member of OEIS A226154: smallest of four consecutive primes whose sum is a triangular number. Triangular numbers are of the form:$$ \binom{n}{2}= \frac{n \, (n-1)}{2}$$The initial members of this sequence are: 5, 23, 191, 389, 449, 2593, 3011, 5167, 5639, 5851, 8669, 18839, 25463. Here the four primes add to 101926 = 25463+25469+25471+25523 and this sum is a triangular number because: $$101926 = \binom{452}{2}=\frac{452 \times 451}{2}$$ 

Finally and again base independently, 25463 is a member of OEIS A022121: Fibonacci sequence beginning 3, 8. The initial members of this sequence are: 3, 8, 11, 19, 30, 49, 79, 128, 207, 335, 542, 877, 1419, 2296, 3715, 6011, 9726, 15737, 25463.