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”).

A085004
a(n)=2*A085003(n)-n.
3
1, 2, 1, 0, -1, 0, 1, 0, -1, -2, -1, 0, 1, 0, -1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 1, 0, -1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 0, 1, 2, 1, 0, -1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 1, 0, -1, 0, 1, 0, -1, -2, -1, 0, 1, 0, -1, 0, 1, 2, 1, 0, -1, 0, 1, 0, -1, -2, -1, 0, -1, -2, -3, -2, -1, 0, -1, -2, -1, 0, 1, 0, -1, 0, 1, 2, 1, 0, -1
OFFSET
1,2
FORMULA
|a(n+1)-a(n)| = 1. - Charles R Greathouse IV, Feb 07 2013
PROG
(PARI) 2*sum(k=1, n, (k+sqrtint(5*k^2))%4>1)-n \\ Charles R Greathouse IV, Feb 07 2013
CROSSREFS
KEYWORD
sign
AUTHOR
Benoit Cloitre, Jun 17 2003
STATUS
approved