login
This site is supported by donations to The OEIS Foundation.

 

Logo

110 people attended OEIS-50 (videos, suggestions); annual fundraising drive to start soon (donate); editors, please edit! (stack is over 300), your editing is more valuable than any donation.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A010751 Up 1, down 2, up 3, down 4, ... 0
0, 1, 0, -1, 0, 1, 2, 1, 0, -1, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -2, -1, 0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -3, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -5, -4 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,7

LINKS

Table of n, a(n) for n=0..80.

FORMULA

a(n)=x+1-(sign(x(2x+1)-y(2y+1)))*(n-2x^2-3x-1) where x=floor((-1-sqrt(1+8n))/4), y=-floor((1-sqrt(1+8n))/4), sign(x)=abs(x)/x when x is not 0 and sign(0)=0, floor(x)=the greatest integer less than or equal to x, sqrt(x)=the principal square root of x and abs(x)=the absolute value (or magnitude) of x. - Mark Spindler, Mar 25 2004

MATHEMATICA

n=(the index); x = -1; y = 0; While[n != 0, While[y != x && n != 0, y--; n-- ]; While[y != -x && n != 0, n--; y++ ]; x-- ]; Print[ -y] provided by Gregory Puleo n = (the index); a = Floor[(-1 - Sqrt[1 + 8* n])/4]; b = -Floor[(1 - Sqrt[1 + 8*n])/4]; a + 1 - Sign[a*(2*a + 1) - b*(2*b + 1)]*(n - 2*a^2 - 3*a - 1) (provided by Mark Spindler)

CROSSREFS

Sequence in context: A054848 A194525 A065368 * A194523 A180714 A170959

Adjacent sequences:  A010748 A010749 A010750 * A010752 A010753 A010754

KEYWORD

sign

AUTHOR

David Berends (dave(AT)pgt.com)

STATUS

approved

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

Content is available under The OEIS End-User License Agreement .

Last modified October 30 12:04 EDT 2014. Contains 248801 sequences.