login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A275720
a(1) = 0; for n > 1, if A003961(n) > A003961(n-1) then a(n) = a(n-1) + 1, otherwise if A003961(n) < A003961(n-1), then a(n) = a(n-1) - 1.
4
0, 1, 2, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 2, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, -1, 0, 1, 0, 1, 2, 3, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 4, 5
OFFSET
1,3
LINKS
FORMULA
a(1) = 0; for n > 1, if A003961(n) > A003961(n-1) then a(n) = a(n-1) + 1, otherwise if A003961(n) < A003961(n-1), then a(n) = a(n-1) - 1.
PROG
(Scheme, with memoization-macro definec)
(definec (A275720 n) (if (= 1 n) 0 (+ (A275720 (- n 1)) (if (> (A003961 n) (A003961 (- n 1))) 1 -1))))
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Aug 07 2016
STATUS
approved