Chaotic Matrix

Algebra Level 5

Let A ( n ) A(n) be an n × n n\times n square matrix such that A i j = 1 A_{ij}=1 if either j = 1 j=1 or i i divides j j , otherwise, A i j = 0 A_{ij}=0 .

You can see that A ( 2 ) = ( 1 1 1 1 ) A(2)=\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} and det ( A ( 2 ) ) = 0 \operatorname{det}\left(A(2)\right)=0 .

Find the next value of n n for which det ( A ( n ) ) = 0 \operatorname{det}\left(A(n)\right)=0 .


The answer is 39.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Atomsky Jahid
Aug 9, 2020

I expanded the matrix along the column 1 1 .

Make all the elements in the first column of A A zero, except at the position ( x , 1 ) (x, 1) , and call the new matrix D x , 1 D_{x, 1} . The following formula can be used to calculate the determinant of D x , 1 D_{x,1} .

D x , 1 = 1 y D y , 1 |D_{x,1}| = -1 - \sum_{y} |D_{y,1}| where y y is a non-trivial positive divisor of x x .

Notice that the determinant of D x , 1 D_{x, 1} does not depend on the size of the matrix. So, I stored the determinants of D x , 1 D_{x, 1} in a list d d . This list can then be used to find the determinant of A A as follows.

A ( n + 1 ) = A ( n ) + D n , 1 | A (n+1) | = | A (n) | + | D_{n, 1} |

The value of the determinants are stored in the list a a .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
d = [0, 1, -1]
a = [0, 1, 0]

n = int(input("Size of the matrix... "))

for x in range(3, n+1):
    d.append(-1)
    for y in range(2, int(x/2)+1):
        if x % y == 0:
            d[x] -= d[y]

    a.append(a[-1] + d[-1])

for i, v in enumerate(a):
    print(i, v)

This matrix is called the Redheffer matrix

Digvijay Singh - 10 months, 1 week ago

Log in to reply

Basically, I need to find when Mertens function produces 0 0 . The chaotic manner of it (and the lack of something analytical) means I am better off not knowing about this.

Atomsky Jahid - 10 months ago

Brilliant solution.

Yuriy Kazakov - 10 months, 1 week ago

Log in to reply

Thanks. I have tried to find an analytical solution first. Failing to do so, I focused on finding an efficient algorithm to find the determinants of such matrices. This program can find the determinants of the first 1000 1000 matrices in 50 m s 50 \> ms , which was good enough for me.

Atomsky Jahid - 10 months ago
Yuriy Kazakov
Aug 7, 2020

I use Mathcad. And find A028442

I spent a whole day to find a formula for this. After being frustrated, I wrote a python program to solve it. Sigh!

Atomsky Jahid - 10 months, 1 week ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...