A297103 The number of equal-sized squares in the highest stack of squares contained in successive Genealodrons formed from 2^n - 1 equal-sized squares.
1, 1, 1, 2, 5, 7, 10, 20, 41, 67, 110, 220, 441, 767, 1335, 2670, 5341, 9587, 17211, 34422, 68845, 126011, 230655, 461310, 922621, 1711595, 3175311, 6350622, 12701245, 23796515, 44584536, 89169072, 178338145
Offset: 1
Links
- Andrew Smith, Illustration of initial terms
Programs
-
MATLAB
%I solved the problem by representing each Genealodron as a matrix n=input('how many terms?'); %preallocation of length of output (length n) vec=zeros(1,n); %below I initialize the first 3 terms which are easily done with pen and paper vec(1)=1; vec(2)=1; vec(3)=1; %imat is the intermediate matrix to go from 3rd to 4th matrix. imat=[1,0,1;0,0,0;1,0,1]; %mat is the 3rd matrix mat=[1,0,1;1,1,1;1,0,1]; %loop for i=4:n %when i is even if mod(i,2)==0 imat2=[zeros(i-1,2),imat]; imat3=[imat,zeros(i-1,2)]; %superposing two variations of previous intermediate matrix to get next one imat=imat2+imat3; %making mat same size as imat mat=[zeros(i-1,1),mat,zeros(i-1,1)]; %calculating new matrix (=old matrix+intermediate) mat=mat+imat; %similarly when i is odd else imat2=[zeros(2,i);imat]; imat3=[imat;zeros(2,i)]; imat=imat2+imat3; mat=[zeros(1,i);mat;zeros(1,i)]; mat=mat+imat; end %working out the maximum value of new matrix and allocating it to a position in the output vector vec(i)=max(max(mat)); end format long g disp(vec)
Comments