Showing posts with label arithmetical operations. Show all posts
Showing posts with label arithmetical operations. Show all posts

Thursday, 8 October 2020

Forming Equations from Integers


Read on!

Once upon a time, before I started this exclusively mathematical blog in 2015, I used to post occasional mathematical content to my Pedagogical Posturing blog at https://voodoo-guru.blogspot.com. I was looking back at some of these posts and noticed this one, from Saturday, 24 August 2013, titled Forming Equations from Integer Sequences. It's only short so I'll quote it in full:

Recently I've been using Twitter to create a daily tweet that records my "day count" (number of days I've been alive) plus its factors (if not prime) and some interesting facts about the number itself or one of its factors. Sometimes there's little to say about the number and in such cases I've found that I can usually form an equation by inserting mathematical operators between one or more of the digits. 

For example, yesterday the count was \(23518\) and \(23 - 5 = 18.\) Today the count is \(23519\) and \(2 + 3 + 5 - 1 = 9\). I was wondering if it's always possible to create an equation from five digits using the standard mathematical operators (addition, subtraction, multiplication, division and exponentiation in combination with brackets). Obviously with just two digits, it's only possible when the digits are repeated e.g. \(99\) becomes \(9 = 9\). With three digits, it's sometimes possible e.g. \(819\) becomes \(8 + 1 = 9\) but generally it isn't e.g. \(219\). With four digits, it's more possible e.g. \(2119\) becomes \(-2 + 11 = 9\) but I'm doubtful whether this is always so. There must come a point however, where the number of digits is sufficient to ensure that it's always so. Maybe five digits is that point.

From now on, I'll try each day to form an equation to test out this theory. For example, tomorrow the count is \(23520\) which becomes \(2+3-5=2 \times 0 \) and it works for tomorrow but beyond that let's see.

Well, I didn't keep my promise of trying to form an equation each day from the digits making up my diurnal age. I have however, written about selfie numbers in a post of Friday, 27th March 2020 to my Mathematical Meanderings blog site. These are somewhat similar in spirit. In that post, I also mention Friedman numbers that can be described as follows:

Consider \(28547 =(8+5)^4−(7 \times 2)\) expressed in base 10, both sides use the same digits. An integer is a Friedman number if it can be put into an equation such that both sides use the same digits but the right hand side has one or more basic arithmetic operators (addition, subtraction, multiplication, division, exponentiation) interspersed. Brackets, as usual, are essential to clarify the order of operations. These numbers are named after Erich Friedman, Assoc. Professor of Mathematics at Stetson University. With the help of his students he has researched Friedman numbers in bases 2 through 10 and even with Roman numerals. When both sides use the digits in the same order, the number is called a ”nice” or ”strong” Friedman number. For example, \( 3125=(3+[1\times2])^5.\)

My approach is similar to this except I'm trying to create an equation from the digits (using them in the same order as they appear in the number). As another example, today I'm \(26121\) days old and this is an easy one because \( (2 \times 6)/12=1 \) if we allow concatenation of digits. If only individual digits are allowed, then \(-(2-6)=1+2+1 \) satisfies. It's probably better to use the individual digits as is done with the Friedman numbers. I'll try to include this as part of my daily number analysis. 

Going back a few days, we have:

  • \(26120 \text{ --> } 2 = \frac{6}{1 + 2 +0} \)
  • \(26119 \text{ --> } 2 + 6 \times 1 = -1 + 9 \)
  • \(26118 \text{ --> } 2 + 6 + 1 = 1 + 8 \)
  • \(26117 \text{ --> } 2 + 6 = 1 \times 1 + 7 \)
  • \(26116 \text{ --> } 2 + 6 = 1 + 1 + 6 \)
  • \(26115 \text{ --> } -2 + 6 + 1 \times 1 = 5 \)
  • \(26114 \text{ --> } -2 + 6 = 1 - 1 + 4 \)
  • \(26113 \text{ --> } -2 + 6 = 1 \times 1 + 3 \)
  • \(26112 \text{ --> } -2 + 6 = 1 + 1 + 2 \)
  • \(26111 \text{ --> } 2 = \frac{6}{1+1+1}\)
  • \(26110 \text{ --> } 2 \times 6 \times (1-1) = 0 \)
It seems that it's always possible to form an equation using only brackets and the basic arithmetic operators of addition, subtraction, multiplication, division and exponentiation. Perhaps even the exponentiation is not needed, as the examples above show. Let's see if this assumption holds true for future numbers. This is hardly high level mathematics but it's a simple yet oddly satisfying activity.

Thursday, 9 April 2020

The Doodle Problem


I came across the following problem on this site:
Can you make 100 by interspersing any number of pluses and minuses within the string of digits 9 8 7 6 5 4 3 2 1? You can't change the order of the digits! So what's the least number of pluses and minuses needed to make 100?
The originator of the problem called it a "doodle problem" because he felt it was "one that's best worked on during meetings where you might be doodling otherwise". It's easy enough to come up with a solution but not necessarily one that involves the least number of pluses and minuses. My solution was 9-8+76-5+4+3+21.

Referring to the originator's solution (link), he began:
A lot of trial and error is needed, and, although there are ways to help limit the set of possibilities, there isn’t a surefire method of arriving at a solution in a reasonable amount of time with a pen and paper. 
To start with, we might notice the first two digits make the number 98, which is quite close to 100. So, if we can add and subtract the rest of the single digits to make 2, then we’ll have 100. In fact, there are eight ways to do this: 
98 + 7 + 6 - 5 - 4 - 3 + 2 - 1 
98 + 7 - 6 + 5 - 4 + 3 - 2 - 1 
98 + 7 - 6 + 5 - 4 - 3 + 2 + 1 
98 + 7 - 6 - 5 + 4 + 3 - 2 + 1 
98 - 7 + 6 + 5 + 4 - 3 - 2 - 1 
98 - 7 + 6 + 5 - 4 + 3 - 2 + 1 
98 - 7 + 6 - 5 + 4 + 3 + 2 - 1 
98 - 7 - 6 + 5 + 4 + 3 + 2 + 1 
But we can do better—we can make 100 with fewer than 7 pluses and minuses. 
Here’s one way to make sure we find all possibilities: use a computer simulation. Each pair of digits can be connected by either nothing, a plus sign, or a minus sign. Since there are eight paired connections, there are \(3^8 = 6,561\) possible combinations of pluses and minuses. I simulated each one of these combinations to determine which sum to 100.
So at least my solution involved only six pluses and minuses but this may still not be the least number possible. I was intrigued at the prospect of a computer simulation using SageMathCell to find all possible solutions along with those that contained the minimum number possible. However, I haven't been able to figure out how to do this. I'll keep trying.

The originator succeeded with his computer simulation however, and came up with the following results:
The simulation unearthed that there are seven other ways of making 100: 
98 - 7 - 6 - 5 - 4 + 3 + 21 
9 + 8 + 76 + 5 + 4 - 3 + 2 - 1 
9 + 8 + 76 + 5 - 4 + 3 + 2 + 1 
9 - 8 + 76 + 54 - 32 + 1 
9 - 8 + 76 - 5 + 4 + 3 + 21 
9 - 8 + 7 + 65 - 4 + 32 - 1 
98 - 76 + 54 + 3 + 21 
The bolded solution is the winner. It uses only four pluses and minuses! 
The computer simulation also revealed that it’s possible to make every number from 1 to 100, which could keep you doodling for many meetings. In fact, it’s possible to make every number in more ways than one with one notable exception: 9 + 87 - 65 + 4 - 32 - 1 is the unique way to make 2.
This interesting little problem is similar to the selfie numbers that I posted about recently. The difference is that more operations than just addition and subtraction can be used in creating selfie numbers and the goal with them is always to recreate the original number. Here is a link to that post.