Monday, February 17, 2025

Using Excel Solver to Find the Solution to a Geometry Puzzle

The Monday Puzzle in the Guardian by Alex Bellos had a good problem to illustrate the use of Excel Solver. The link to the article is: https://www.theguardian.com/science/2025/feb/17/did-you-solve-it-the-simple-geometry-problem-that-fools-almost-everyone.

Restated, the problem is to divide an 11 x 11 square into five rectangles so that the ten side lengths are the whole numbers from 1 to 10? 

Below is the 11 x 11 square with five rectangles and the ten sides labeled A through J. 


To use Excel Solver to find a solution, ten cells of the spreadsheet will be designated as the decision variables. In the attached spreadsheet, these are simply the cells A1 through J1. Solver will change their values until a solution is found. 

In rows 3 through 8 are 6 constraints:
A+D=11
C+F=11
E+H=11
G+B=11
H+J+D=11
B+I+F=11

Also in Solver, additional constraints are entered:
All values, A through J, are => 1 and <= 10.
All values, A through J, are integers.
All values, A through J, are different.

With these constraints entered, click the Solve button, and one of the solutions is displayed:

A=6, B=3, C=10, D=5, E=9, F=1, G=8, H=2, I=7, J=4






Saturday, February 1, 2025

Project Euler - Part 2


Five years ago I started the Project Euler Challenge. At the time, I was learning Python and used the challenge as a way to develop my programming skill. 


Over the last two years, I've been learning Mathematica: On-line version. I decided to revisit my Project Euler project and found that I was able to complete several more of the problems using Mathematica. There are a total of 929 posted problems; I've only solved 50, so I have a long way to go.






Thursday, January 23, 2025

A380198 Contribution to the OEIS

Difference between pi(2^n) and the integer nearest to 2^n / log(2^n).
0
-2, -1, 0, 0, 2, 3, 5, 8, 15, 24, 40, 72, 119, 212, 360, 633, 1128, 1989, 3580, 6386, 11537, 20897, 37980, 69354, 127336, 234054, 431877, 799754, 1484440, 2763961, 5156791, 9644970, 18080775, 33959344, 63902732, 120474951, 227515953, 430345298, 815241632
OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..92
FORMULA
a(n) = - A053622(2^n).
a(n) = A007053(n) - A050499(2^n).
EXAMPLE
n 2^n pi(2^n) round(2^n/log(2^n) a(n)
------------------------------------------------
1 2 1 3 -2
2 4 2 3 -1
3 8 4 4 0
4 16 6 6 0
MATHEMATICA
Table[PrimePi[2^n]-Round[2^n/Log[2^n]], {n, 39}]
KEYWORD
sign,new
AUTHOR
James C. McMahon, Jan 16 2025
STATUS
approved

Friday, January 17, 2025

Very Large and Easy-to-Remember Prime Numbers


There was a recent article about asking people to name a prime number. One answer was given as 2^31-1; however, the responder was asked to recite the digits. He couldn't remember the digits of 2^31-1, which are 2,147,483,647. His friend, Neil  Sloane, offered another large prime: 12,345,678,910,987,654,321. It is easy to remember because one just needs to count from 1 to 10 and then back down to 1. The original story is recounted in this Scientific American article:  These Prime Numbers Are So Memorable That People Hunt for Them.

The number cited above is found in the OEIS sequence A350153.  

Other related sequences are:

A048847, Primes formed by concatenation of first k odd numbers.

A173426, a(n) is obtained by starting with 1, sequentially concatenating all decimal numbers up to n, and then, starting from n-1, sequentially concatenating all decimal numbers down to 1.

A260343, Numbers n such that the base-n number formed by concatenating the base-n numbers 1 2 ... n-1 n n-1 ... 2 1 is prime.

A323532, Numbers k such that the decimal concatenation of the numbers from 1 up to k followed by digit reversals of the numbers from (k-1) down to 1 is a prime.

Saturday, January 11, 2025

A377723 Contribution to the OEIS

 A377723

Numbers whose number of prime factors (counted with repetition) is greater than or equal to its smallest prime factor.
0
4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 27, 28, 30, 32, 34, 36, 38, 40, 42, 44, 45, 46, 48, 50, 52, 54, 56, 58, 60, 62, 63, 64, 66, 68, 70, 72, 74, 75, 76, 78, 80, 81, 82, 84, 86, 88, 90, 92, 94, 96, 98, 99, 100, 102, 104, 105, 106, 108, 110, 112, 114, 116
OFFSET
1,1
COMMENTS
Numbers k such that A001222(k) >= A020639(k).
Complement of A091377.
A091371(a(n)) < 1: A001222(a(n)) => A020639(a(n)).
LINKS
EXAMPLE
4 is a term because bigomega(4) = spf(4) = 2.
12 is a term because bigomega(12) = 3 > spf(12) = 2.
3 is not a term because bigomega(3) = 1 < spf(3) = 3.
MATHEMATICA
Select[Range[116], PrimeOmega[#]>=FactorInteger[#][[1, 1]]&]
KEYWORD
nonn,new
AUTHOR
James C. McMahon, Dec 28 2024
STATUS
approved

An Open Message to the Blog's Fans in Singapore

(Image:  Free 12 singapore icons - Iconfinder ) This past week, more views of this blog were made from Singapore than other country. To ackn...

Popular in last 30 days