This site is supported by donations to The OEIS Foundation.



Annual Appeal: Please make a donation to keep the OEIS running. In 2018 we replaced the server with a faster one, added 20000 new sequences, and reached 7000 citations (often saying "discovered thanks to the OEIS").
Other ways to donate

(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078943 a(1)=1; a(n+1) is either a(n)-n or a(n)+n, where we choose the smallest one which is a positive integer that's not among the values a(1), ..., a(n). 3
1, 2, 4, 7, 3, 8, 14, 21, 13, 22, 12, 23, 11, 24, 10, 25, 9, 26, 44, 63, 43, 64, 42, 19 (list; graph; refs; listen; history; text; internal format)



After a(24)=19, there are no more terms because a(24)-24 = -5 is not positive and a(24)+24 = 43 is equal to a(21).

If we only require that a(n+1) be either a(n)-n or a(n)+n, is there a sequence that contains every positive integer exactly once? I.e. can we take a walk on the positive integers, starting at 1 and always moving (either left or right) a distance n on the n-th step, so that we hit every positive integer exactly once?


Table of n, a(n) for n=1..24.


a(9)=13, so a(10) is either 13-9=4 or 13+9=22. But 4 is not available since it equals a(3), so a(10)=22.


Consists of terms 1 through 25 of A063733.

Sequence in context: A081145 A100707 A302663 * A063733 A187089 A141330

Adjacent sequences:  A078940 A078941 A078942 * A078944 A078945 A078946




Leroy Quet, Dec 15 2002


Edited by Dean Hickerson, Dec 18 2002



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

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 11 15:03 EST 2018. Contains 318049 sequences. (Running on oeis4.)