OFFSET
1,4
COMMENTS
It seems likely that every number will eventually appear.
REFERENCES
Popular Computing (Calabasas, CA), Z-Sequences, Vol. 4 (No. 42, Sep 1976), pp. 12-16.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..20000 (first 1000 terms from T. D. Noe)
Popular Computing (Calabasas, CA), Z-Sequences, continued. Annotated and scanned copy of pages 14, 15, 16, 18 of Vol. 5 (No. 56, Nov 1977).
MAPLE
f:=proc(n) option remember;
if n <= 1 then 1 else abs(2*f(n-2)+f(n-1)-n); fi; end;
[seq(f(n), n=1..60)]; # N. J. A. Sloane, Apr 16 2015
MATHEMATICA
RecurrenceTable[{a[1]==a[2]==1, a[n]==Abs[a[n-1]+2a[n-2]-n]}, a, {n, 90}] (* Harvey P. Dale, Mar 23 2012 *)
PROG
(Haskell)
a005210 n = a005210_list !! (n-1)
a005210_list = 1 : 1 : (zipWith ((abs .) . (-))
[3..] $ zipWith (+) (tail a005210_list) (map (2 *) a005210_list))
-- Reinhard Zumkeller, Aug 11 2014
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from David W. Wilson
STATUS
approved