|
|
A229035
|
|
Partial sums of A082233 (read sequentially meandering).
|
|
2
|
|
|
1, 3, 6, 11, 15, 18, 22, 27, 33, 40, 49, 57, 64, 70, 75, 81, 88, 96, 105, 115, 126, 139, 151, 162, 172, 181, 189, 196, 204, 213, 223, 234, 246, 259, 273, 288, 305, 321, 336, 350, 363, 375, 386, 396, 405, 415, 426, 438, 451, 465, 480, 496
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
1,2,3,4,5,6,7,8,9,10
3,4,5,6,7,8,9,10,11,12
5,6,7,8,9,10,11,12,13,14
so this sequence begins 1, 1+2, 1+2+3, 1+2+3+5, 1+2+3+5+4, etc...
|
|
MAPLE
|
r:=0 ;
c:=1 ;
2*n+k ;
end proc:
option remember;
global r, c ;
local d;
if n = 0 then
else
d := r+c ;
if type(d, 'odd') then
c := c+1 ;
r := r-1 ;
if r < 0 then
r :=0 ;
end if;
else
c := c-1 ;
r := r+1 ;
if c < 1 then
c :=1 ;
end if;
end if;
end if;
|
|
PROG
|
(JavaScript)
a=new Array();
for (i=0; i<10; i++) {
a[i]=new Array();
for (j=0; j<10; j++) a[i][j]=1+2*i+j;
}
for (i=0; i<10; i++) document.write(a[i]+'<br>');
document.write('<br>');
xp=0; yp=0; d=0; s=1;
document.write(s+", ");
for (i=0; i<4; i++) {
if (d==0) {xp++; d=1; s+=a[yp][xp]; document.write(s+", "); }
if (d==1) {while (xp>0) {xp--; yp++; s+=a[yp][xp]; document.write(s+", "); }; d=2; }
if (d==2) {yp++; d=3; s+=a[yp][xp]; document.write(s+", "); }
if (d==3) {while (yp>0) {xp++; yp--; s+=a[yp][xp]; document.write(s+", "); }; d=0; }
}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|