Showing posts with label pattern. Show all posts
Showing posts with label pattern. Show all posts

Wednesday, 24 April 2024

Visualising Sequences

While playing around with the patterns produced by some sequences, I discovered some interesting patterns. It began with the sequence produced by$$ \text{a}(n)=\sin(n) \cdot e^{-0.001 \cdot n}$$for values of \(n\) from 0 to 2000. See Figure 1 (permalink).


Figure 1

What's interesting is the hexagonal arrangement of the points. The values cannot exceed \( \pm \)1 and the exponential component brings progressive values closer and closer to zero, although at a very slow rate. The pattern becomes rather different once we introduce another element as follows:$$ \text{a}(n)=n \cdot \sin(n) \cdot e^{-0.001 \cdot n}$$for values of \(9n\) from 0 to 4000. See Figure 2 (permalink).


Figure 2

Values range from about - 367 to + 367. Once again, the exponential component eventually dominates and the range of values inexorably decrease. Increasing the exponent of the \(n\) element doesn't really alter the pattern. For example, raising the \(n\) to the fourth power:$$ \text{a}(n)=n^4 \cdot \sin(n) \cdot e^{-0.001 \cdot n}$$for values of \(n\) from 0 to 8000 produces the pattern shown in Figure 3 (permalink).


Figure 4

So nothing profound in this post, just interesting now inputting integral values into a function and plotting the output produces interesting patterns. You can see the same general shape using a program like GeoGebra but the patterns shown do not emerge. See Figure 4.


Figure 4

As can be seen from Figure 4, negative value of \(n\) cause the output values to explode. Of course, most of the sequences that I examine in this blog are integer sequences, the result of integer output from integer input, as found in the OEIS. It's interesting however, from time to time, to examine non-integer output from integer input, as I've done in this post. 

Finally, before we do, consider Figure 5 (permalink) that shows an interesting result for a sequence generated by:$$ \text{a}(n)=n \cdot e^{ \, \sin(x)}$$where the two bounding lines are given by \(y=e \cdot x\) and \(y=1/e \cdot x\).


Figure 5

Tuesday, 28 March 2023

2023 TO THE POWER OF 2023

This is a puzzle that appeared on March 27th 2023 as a post in a blog titled PUZZLE A DAY. The challenge is to find the last digit of 2023 to the power of 2023? The clue provided is that there is a pattern to be found. Work out the last digit of 2023 to the power of 1, 2, 3, 4 and 5.

I used SageMathCell to generate the numbers for 2023 raised to the powers 1 to 12. The results were (permalink):

\(2023^1 \rightarrow 2023\)
\(2023^2 \rightarrow 4092529\)
\(2023^3 \rightarrow 8279186167\)
\(2023^4 \rightarrow 16748793615841\)
\(2023^5 \rightarrow 33882809484846343\)
\(2023^6 \rightarrow 68544923587844151889\)
\(2023^7 \rightarrow 138666380418208719271447\)
\(2023^8 \rightarrow 280522087586036239086137281\)
\(2023^9 \rightarrow 567496183186551311671255719463\)
\(2023^{10} \rightarrow 1148044778586393303510950320473649\)
\(2023^{11} \rightarrow 2322494587080273653002652498318191927\)
\(2023^{12} \rightarrow 4698406549663393600024366004097702268321\)

The repeating pattern 1, 3, 9, 7 of final digits is apparent. This is not surprising when we consider that it is only the final digit that we are interested in and that 3 raised to the same powers produces the same pattern:

\(3^1 \rightarrow 3\)
\(3^2 \rightarrow 9\)
\(3^3 \rightarrow 27\)
\(3^4 \rightarrow 81\)
\(3^5 \rightarrow 243\)
\(3^6 \rightarrow 729\)
\(3^7 \rightarrow 2187\)
\(3^8 \rightarrow 6561\)
\(3^9 \rightarrow 19683\)
\(3^{10} \rightarrow 59049\)
\(3^{11} \rightarrow 177147\)
\(3^{12} \rightarrow 531441\)

Every power that is a multiple of 4 ends in a 1 and so all we need to do is to divide 2023 by 4 which leaves a remainder of 3. Thus 2023 to the power 2023 is three positions ahead of the 1 and so the final digit must be 7. In general, any number that ends in 3, when raised to consecutive powers, will follow this same 1, 3, 9, 7 pattern just as 3 and 2023 do.

Generalising, we can look at numbers ending in digits 0 to 9. Here is the pattern for integer powers greater than zero:
  • 0 --> numbers ending in 0 will always end in 0
  • 1 --> numbers ending in 1 will always end in 1
  • 2 -->  numbers ending in 2 will follow a 2, 4, 8, 6 pattern
  • 3 -->  numbers ending in 3 will follow a 1, 3, 9, 7 pattern
  • 4 --> numbers ending in 4 will follow a 4, 6 pattern
  • 5 --> numbers ending in 5 will always end in 5
  • 6 --> numbers ending in 6 will always end in 6
  • 7 --> numbers ending in 7 will follow a 1, 7, 9, 3 pattern
  • 8 --> numbers ending in 8 will follow a 2, 6, 8, 4 pattern
  • 9 --> number ending in 9 will follow a 1, 9 pattern

So a question like what is final digit of 2028 raised to the power 2028 is easily answered. Let's look at the powers of 2028 from 1 to 12:

\(2028^1 \rightarrow 2028\)
\(2028^2 \rightarrow 4112784\)
\(2028^3 \rightarrow 8340725952\)
\(2028^4 \rightarrow 16914992230656\)
\(2028^5 \rightarrow 34303604243770368\)
\(2028^6 \rightarrow 69567709406366306304\)
\(2028^7 \rightarrow 141083314676110869184512\)
\(2028^8 \rightarrow 286116962163152842706190336\)
\(2028^9 \rightarrow 580245199266873965008154001408\)
\(2028^{10} \rightarrow 1176737264113220401036536314855424\)
\(2028^{11} \rightarrow 2386423171621610973302095646526799872\)
\(2028^{12} \rightarrow 4839666192048627053856649971156350140416\)

All multiples of 4 end in 6 and if we divides 2028 by 6 we get 0 and so 2028 raised to the power 2028 must end in 6 as well. This is just my way of looking at the problem and there are surely other approaches.

Overall the PUZZLE A DAY site looks interesting, providing as it does a little mathematical challenge each day.