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!)
A369829 a(0) = 0; for n > 0, if n appears in the sequence then a(n) = a(n-1) - sum of indexes where n appeared if that is nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + sum of indexes. Otherwise a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n. 0
0, 1, 3, 5, 9, 6, 11, 4, 12, 8, 18, 24, 16, 29, 15, 29, 17, 33, 23, 42, 22, 43, 63, 45, 34, 59, 85, 58, 30, 2, 30, 61, 93, 76, 52, 87, 51, 14, 52, 13, 53, 94, 75, 54, 10, 33, 79, 32, 80, 31, 81, 117, 189, 149, 106, 161, 105, 48, 21, 80, 20 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
EXAMPLE
a(3) = 5 as a(2) = 3 = n, thus the step size from a(2) is 2. As 1 has previously appeared a(3) = a(2) + 2 = 3 + 2 = 5.
a(5) = 6 as a(3) = 5 = n, thus the step size from a(4) is 3. As 6 has not previously appeared a(5) = a(4) - 3 = 9 - 3 = 6.
a(29) = 2 as a(13) = 29 = n, and a(15) = 29, 13+15 is 28, thus the step size from a(2) is 28. As 2 has not previously appeared a(29) = a(29) - 28 = 30 - 28 = 2.
CROSSREFS
Sequence in context: A231736 A212437 A048639 * A340593 A021282 A016613
KEYWORD
nonn
AUTHOR
Kelvin Voskuijl, Feb 02 2024
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 June 29 12:30 EDT 2024. Contains 373848 sequences. (Running on oeis4.)