Wikipedia:Reference desk/Archives/Mathematics/2023 March 4

= March 4 =

Formula for a sequence
Is there a formula for the sequence 2,2,8,8,18,18,32,32? It is the number of chemical elements in each period of a left-step or Janet periodic table.

In contrast, the formula for the number of elements in each period of a conventional periodic table (2,8,8,18,18,32,32) is:
 * a(n) = (2*n+3+(−1)^n)^2/8

thank you, Sandbh (talk) 02:28, 4 March 2023 (UTC)


 * You can use b(n) = a(n−1) = (2*(n−1)+3+(−1)^(n−1))^2/8 = (2*n+1−(−1)^n)^2/8. --Lambiam 03:20, 4 March 2023 (UTC)
 * Thank you. Sandbh (talk) 06:15, 6 March 2023 (UTC)
 * A simple formula that generates these particular 8 numbers is $$2 {\lceil n/2 \rceil}^2$$. CodeTalker (talk) 07:31, 4 March 2023 (UTC)
 * Do the square brackets mean round up? Sandbh (talk) 06:15, 6 March 2023 (UTC)
 * Yes, they denote the ceiling function. But note that their shapes have one less corner than square brackets. --Lambiam 09:42, 6 March 2023 (UTC)

Why does the units digit of an integer equal the units digit of its fifth power?
Fifth_power_(algebra) notes For any integer n, the last decimal digit of n5 is the same as the last (decimal) digit of n, i.e.
 * $ n \equiv n^5\pmod {10}$

Is it a coincidence, or is there a fundamental reason it must be so? Thanks, cm&#610;&#671;ee&#9094;&#964;a&#671;&#954; 07:22, 4 March 2023 (UTC)
 * Let n be written as $$10a+b$$, where b is the low order digit (between 0 and 9 inclusive). Then expanding by the binomial theorem, $$n^5 = {(10a+b)}^5 = 10^5a^5 + 5 \cdot 10^4a^4b + 10 \cdot 10^3a^3b^2 +10 \cdot 10^2a^2b^3 + 5 \cdot 10ab^4 + b^5$$ Every term except the last is a multiple of 10, so to show that $$n^5 \equiv n \bmod 10$$, we just need to show that $$b^5 \equiv b \bmod 10$$ for every value of b between 0 and 9. This can be done by enumeration, and observing that the last digit of $$b^5$$ is equal to $$b$$ in all cases: $$0^5=0; 1^5 = 1; 2^5=32; 3^5=243; 4^5=1024; 5^5=3125; 6^5=7776; 7^5=16807; 8^5=32768; 9^5=59049$$. CodeTalker (talk) 07:52, 4 March 2023 (UTC)


 * Another, rather different proof. The decimal representations of $$n^5$$ and $$n$$ share their last digit when $$n^5{-}n$$ is a multiple of $$10,$$ or, equivalently, when it is both a multiple of $$2$$ and of $$5$$. From the factorization $$n^5{-}n=(n{-}1)n(n{+}1)(n^2{+}1)$$ it is obvious that the difference is even. It remains to show that it is a multiple of $$5$$. For this, we use modular arithmetic modulo $$5.$$ In what follows, I write $$a\equiv b(\text{mod}~5)$$ as $$a\equiv b$$ for the sake of concision. Using the fact that modular congruence is a congruence relation with respect to the ring structure of arithmetic, we have:
 * $$n^5-n\equiv(n{-}1)n(n{+}1)(n^2{+}1)\equiv$$ $$(n{-}1)n(n{-}4)(n^2{-}4)\equiv$$ $$(n1)n(n{-}4)(n{-}2)(n{+}2)\equiv$$ $$(n{-}1)n(n{-}4)(n{-}2)(n{-}3)\equiv$$ $$n(n{-}1)(n{-}2)(n{-}3)(n{-}4).$$
 * For all $$n$$, one of these five factors is congruent to $$0.$$ --Lambiam 13:12, 4 March 2023 (UTC)
 * $$n^5 \equiv n \pmod{5}$$ by Fermat's little theorem; $$n^5 \equiv n \pmod{2}$$ trivially; therefore $$n^5 \equiv n \pmod{10}$$. 116.86.4.41 (talk) 13:44, 4 March 2023 (UTC)
 * Thank you very much, everyone. So it's a bit of both: our base, 10 happens to be 2 &times; 5. Cheers, cm&#610;&#671;ee&#9094;&#964;a&#671;&#954; 15:17, 4 March 2023 (UTC)
 * Indeed, it is a bit of a coincidence, not a truly fundamental reason. For example, it does not work in bases 12 and 16: (212)5 = 25 = 32 = 2812 and (216)5 = 25 = 32 = 2016. Next to base 10, the property holds for bases 2, 3, 5, 6, 15 and 30. --Lambiam 16:41, 4 March 2023 (UTC)
 * More generally, I think this holds: There exist a power m > 1 such that nm always ends in the same base b digit as n iff b is square-free. PrimeHunter (talk) 21:30, 4 March 2023 (UTC)
 * Moreover, it appears that m has this property iff m − 1 is an integral multiple of p − 1 for each prime factor p of b. --Lambiam 23:43, 4 March 2023 (UTC)
 * Thanks very much for the general formula. Cheers, cm&#610;&#671;ee&#9094;&#964;a&#671;&#954; 12:38, 6 March 2023 (UTC)
 * The OEIS sequence A197658 being listed as one plus the reduced totient function A002322 (at least, when squarefree) seems to corroborate this. GalacticShoe (talk) 19:41, 6 March 2023 (UTC)