%I #15 Feb 03 2018 08:54:21
%S 1,1,1,2,5,7,10,20,41,67,110,220,441,767,1335,2670,5341,9587,17211,
%T 34422,68845,126011,230655,461310,922621,1711595,3175311,6350622,
%U 12701245,23796515,44584536,89169072,178338145
%N The number of equal-sized squares in the highest stack of squares contained in successive Genealodrons formed from 2^n - 1 equal-sized squares.
%C The first Genealodron consists of one square.
%C The second Genealodron is formed by joining another equal-sized square to the left edge and to the right edge of the first so that the second Genealodron is made up of three squares.
%C The third Genealodron is formed by joining squares to the upper and lower edges of both the second and third square of the second Genealodron so that the third Genealodron is made up of seven squares.
%C The fourth Genealodron is formed by joining squares to the left and right edges of the fourth, fifth, sixth and seventh squares of the third Genealodron so that the fourth Genealodron has fifteen squares. The fourth Genealodron has the first overlaps, so although it contains 15 squares only 13 are seen when it is viewed from above.
%C The fifth Genealodron is formed by adding 16 more squares to the upper and lower edges of the last eight squares added to the fourth Genealodron so the fifth Genealodron has 31 squares, only 21 of which are seen when it is viewed from above because of the increasing number of overlaps.
%C The sixth Genealodron is formed by adding 32 more squares to the left and right edge of the last 16 squares added to the fifth Genealodron. So the sixth Genealodron has 63 squares only 31 of which are visible.
%C This continues, and the edges on which the new squares are added keep alternating between left and right and then upper and lower.
%C Gradually within the Genealodron, spirals are building counterclockwise and clockwise. The sequence that the Genealodron built with squares generates is different from the one built with equilateral triangles, because when a square is added, the spiral then turns through 90 degrees rather than just 60 degrees.
%H Andrew Smith, <a href="/A297103/a297103_3.pdf">Illustration of initial terms</a>
%o (MATLAB)
%o %I solved the problem by representing each Genealodron as a matrix
%o n=input('how many terms?');
%o %preallocation of length of output (length n)
%o vec=zeros(1,n);
%o %below I initialize the first 3 terms which are easily done with pen and paper
%o vec(1)=1;
%o vec(2)=1;
%o vec(3)=1;
%o %imat is the intermediate matrix to go from 3rd to 4th matrix.
%o imat=[1,0,1;0,0,0;1,0,1];
%o %mat is the 3rd matrix
%o mat=[1,0,1;1,1,1;1,0,1];
%o %loop
%o for i=4:n
%o %when i is even
%o if mod(i,2)==0
%o imat2=[zeros(i-1,2),imat];
%o imat3=[imat,zeros(i-1,2)];
%o %superposing two variations of previous intermediate matrix to get next one
%o imat=imat2+imat3;
%o %making mat same size as imat
%o mat=[zeros(i-1,1),mat,zeros(i-1,1)];
%o %calculating new matrix (=old matrix+intermediate)
%o mat=mat+imat;
%o %similarly when i is odd
%o else
%o imat2=[zeros(2,i);imat];
%o imat3=[imat;zeros(2,i)];
%o imat=imat2+imat3;
%o mat=[zeros(1,i);mat;zeros(1,i)];
%o mat=mat+imat;
%o end
%o %working out the maximum value of new matrix and allocating it to a position in the output vector
%o vec(i)=max(max(mat));
%o end
%o format long g
%o disp(vec)
%Y Cf. A179178, A179316.
%K nonn,easy
%O 1,4
%A _Andrew Smith_, Dec 25 2017