OFFSET
1,3
COMMENTS
Sequence A269783 is defined by A269783(0)=0 and A269783(n+1) = A269783(n) + (-1)^(k+e)*floor(k/2), where k = #{ j<=n | A269783(j)=A269783(n) } and e=1 for A269783(n)>0, else e=0. That is, the 1st, 2nd, 3rd, 4th... occurrence of any positive integer n is followed by n resp. n-1 resp. n+1 resp. n-2, etc., and for zero or negative integers the same with opposite sign.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, C++ program
PROG
(C++) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Mar 08 2016
EXTENSIONS
More terms from Rémy Sigrist, May 21 2023
STATUS
approved