I will send you a personal message with my answer for a 9*9 array. If n is an odd integer with n≥3, how many trees would be hidden standing at the center of an n*n array? Is there a simple formula for the general case?
Math Problem (Medium) (5 pi)
 
    
  
  
  SciFiChess, your question is an interesting number theory problem. Let n=2m+1. First let's divide the square into 8 equivalent segments. So the kth row out from the center has k trees in each segment. For any i between 1 and k-1, if i divides k, then there is a tree in row gcd(i,k) that blocks it. Thus there are phi(k) trees in the kth row of each segment that cannot be seen, where phi(k) is the Euler phi function that tells you how many numbers between 1 and k are relatively prime to k. Therefore, the total number of unseen trees is 8*(sum of k from 1 to m) of (k-phi(k)). I don't imagine there is a simplication of this formula. But here are a few values:
phi(1)=1: 8(1-1)=0, so the 3x3 square has 0 unseen trees.
phi(2)=1: 8(2-1)=8, so the 5x5 square has 0+8=8 unseen trees.
phi(3)=2: 8(3-2)=8, so the 7x7 square has 8+8=16 unseen trees.
phi(4)=2: 8(4-2)=16, so the 9x9 square has 16+16=32 unseen trees.
phi(5)=4: 8(5-4)=8, so the 11x11 square has 32+8=40 unseen trees.
phi(6)=2: 8(6-2)=32, so the 13x13 square has 40+32=72 unseen trees.
phi(7)=6: 8(7-6)=8, so the 15x15 square has 72+8=80 unseen trees.
phi(8)=4: 8(8-4)=32, so the 17x17 square has 80+32=112 unseen trees.
phi(9)=6: 8(9-6)=24, so the 19x19 square has 112+24=136 unseen trees.
phi(10)=4: 8(10-4)=48, so the 21x21 square has 136+48=184 unseen trees.
 
    
  
  
  This is the solution I came up with before reading the other posts.
Let k be a positive integer and let n=2k+1. Label the points in the array using ordered pairs of integers (x,y), where -k≤x≤k and -k≤y≤k. There is a tree at each of these ordered pairs except (0,0).
Let z be the number of ordered pairs of integers (x,y), with 1≤x≤k and 1≤y≤k, such that x and y are NOT relatively prime. The number of hidden trees in an n*n array is 4(z+k-1).
If n=9, then k=4 and z=5, so there are 4(z+k-1)=4(5+4-1)=32 hidden trees in a 9*9 array.
[Edit: This solution computes the number of hidden trees when an observer is at the center of a square n*n array, where n is an odd positive integer.]
 
    
  
  
  This solution computes the number of hidden trees when an observer is at the center of a square n*n array, where n is an even positive integer.
Let k be a positive integer and let n=2k. Label the points in the array using ordered pairs of odd integers (x,y), where -2k+1≤x≤2k-1 and -2k+1≤y≤2k-1. There is a tree at each of these ordered pairs, and the observer is at (0,0).
Let z be the number of ordered pairs of odd integers (x,y), with 1≤x≤2k-1 and 1≤y≤2k-1, such that x and y are NOT relatively prime. When n is an even positive integer, the number of hidden trees in an n*n array is 4z.
 
    
  
  
  I will use the numbers 0, 1 and 2 to create an array. This is a 9*9 array with the observer at the center. There are 32 hidden trees.
0 = Visible Tree
1 = Hidden Tree
2 = Observer
1 0 1 0 1 0 1 0 1
0 1 0 0 1 0 0 1 0
1 0 1 0 1 0 1 0 1
0 0 0 0 0 0 0 0 0
1 1 1 0 2 0 1 1 1
0 0 0 0 0 0 0 0 0
1 0 1 0 1 0 1 0 1
0 1 0 0 1 0 0 1 0
1 0 1 0 1 0 1 0 1
 
     
      
Sorry that I could not be active recently. I had some important family matters to deal with, because of the virus.
Anyway, here is the problem:
The 5 x 5 array of dots represents trees in an orchard. If you were standing at the central spot marked C, you would not be able to see 8 of the 24 trees (shown as X). If you were standing at the center of a 9 x 9 array of trees, how many of the 80 trees would be hidden?