OFFSET
0,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Roger L. Bagula, A Simulation of a Prime Type of Sequence: The Hofstadter Integers [broken link]
MAPLE
MATHEMATICA
q[0] = q[1] = 1;
q[n_] := q[n - q[n - 1]] + q[n - q[n - 2]];
a[1] = 2;
a[n_] := a[n] = a[n - 1] + 2*(q[n] - n/2);
Table[ a[n], {n, 1, 70} ]
PROG
(ARIBAS): function a064550(maxarg: integer); var n, r, rm, q: integer; qar: array; begin qar := alloc(array, maxarg + 1); qar[0] := 1; for n := 1 to maxarg do if n < 2 then q := 1; else q := qar[n - qar[n - 1]] + qar[n - qar[n - 2]]; end; qar[n] := q; if n = 1 then r := 2; else r := rm + round(2*(q - n/2)); end; rm := r; write(r, " "); end; end; a064550(65).
(Haskell)
a064550 n = a064550_list !! n
a064550_list = 1 : 2 : zipWith3 (\a q n -> a + 2 * q - n)
(tail a064550_list) (drop 2 a005185_list) [2..]
-- Reinhard Zumkeller, May 13 2012
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
Roger L. Bagula, Oct 08 2001
EXTENSIONS
STATUS
approved