login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
A082233 begins:
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 ;
A082233 := proc(n, k)
2*n+k ;
end proc:
A229035 := proc(n)
option remember;
global r, c ;
local d;
if n = 0 then
A082233(r, c) ;
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;
procname(n-1)+A082233(r, c) ;
end if;
end proc: # R. J. Mathar, Sep 21 2013
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
Cf. A082233.
Sequence in context: A310098 A310099 A056232 * A187896 A225521 A067278
KEYWORD
nonn
AUTHOR
Jon Perry, Sep 11 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 26 13:13 EDT 2024. Contains 375456 sequences. (Running on oeis4.)