OFFSET
1,2
COMMENTS
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
Alois P. Heinz, Table of n, a(n) for n = 1..1000 (first 250 terms from Reinhard Zumkeller)
Popular Computing (Calabasas, CA), Z-Sequences, continued. Annotated and scanned copy of pages 14, 15, 16, 18 of Vol. 5 (No. 56, Nov 1977).
MATHEMATICA
(* a = A005210 *) a[1] = a[2] = 1; a[n_] := a[n] = Abs[a[n-1] + 2 a[n-2] - n]; record = 0; A005211 = Reap[For[n = 1, n < 5000, n++, If[a[n] > record, record = a[n]; Sow[record]]]][[2, 1]] (* Jean-François Alcover, Nov 06 2016 *)
DeleteDuplicates[RecurrenceTable[{a[1]==a[2]==1, a[n]==Abs[a[n-1]+2a[n-2]-n]}, a, {n, 10000}], GreaterEqual] (* Harvey P. Dale, Jun 12 2022 *)
PROG
(Haskell)
(a005211_list, a242014_list) = unzip $ (1, 1) : f 1 1 where
f i x | y > x = (y, i) : f (i + 1) y
| otherwise = f (i + 1) x
where y = a005210 i
-- Reinhard Zumkeller, Aug 11 2014
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from David W. Wilson
STATUS
approved