A360800 Numbers Sum_{i=1..2r+1} 2^k(i) such that k(1) is even and, for r > 0 and i < 2r+1, the difference k(i+1)-k(i) is > 0 and odd.
1, 4, 7, 16, 19, 25, 28, 31, 64, 67, 73, 76, 79, 97, 100, 103, 112, 115, 121, 124, 127, 256, 259, 265, 268, 271, 289, 292, 295, 304, 307, 313, 316, 319, 385, 388, 391, 400, 403, 409, 412, 415, 448, 451, 457, 460, 463, 481, 484, 487, 496, 499, 505, 508, 511, 1024
Offset: 1
Keywords
Examples
A 5 X m wall is tiled bottom-up with dominos, start profiles: _ _ _ _ _ _ _ _ _ _ _ _ _ ___ ___| | ___| |___ ___| | | | | |___| | | | | | | | | |___|___|_| |___|_|___| |___|_|_|_| |_|___|_|_| |_|_|_|_|_| 0 0 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 = a(1) 4 = a(2) 7 = a(3) 19 = a(5) 31 = a(7) also the mirror images of 1 (16), 19 (25) and 7 (28).
Programs
-
Maxima
block(kmax: 100, a:[], oddsum(y):= block(su1:0, su2:0, pold:0, ok: true, while y>0 and ok do(p:mod(y,2), y:(y-p)/2, if p=1 then(if pold=0 and su2=1 then ok:false, su1:1-su1, su2:0) elseif p=0 then su2:1-su2, pold:p), return(is(ok and su1=1))), for k from 1 thru kmax do if oddsum(k) then a:append(a,[k]),a);
Comments