login
Record values in A005210.
(Formerly M0780)
5

%I M0780 #31 Oct 27 2023 20:02:34

%S 1,2,3,6,11,14,29,44,64,65,74,92,106,127,153,165,211,240,248,288,359,

%T 369,417,441,469,518,581,612,625,666,677,707,804,830,928,944,1001,

%U 1060,1269,1300,1361,1445,1496,1548,1655,1727,1742,1868,1928,2043,2303,2323,2579,2604,2617

%N Record values in A005210.

%C a(n) = A005210(A242014(n)). - _Reinhard Zumkeller_, Aug 11 2014

%D Popular Computing (Calabasas, CA), Z-Sequences, Vol. 4 (No. 42, Sep 1976), pp. 12-16.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Alois P. Heinz, <a href="/A005211/b005211.txt">Table of n, a(n) for n = 1..1000</a> (first 250 terms from Reinhard Zumkeller)

%H Popular Computing (Calabasas, CA), <a href="/A005210/a005210.pdf">Z-Sequences, continued.</a> Annotated and scanned copy of pages 14, 15, 16, 18 of Vol. 5 (No. 56, Nov 1977).

%H J. Shallit, <a href="/A001787/a001787.pdf">Letter to N. J. A. Sloane Mar 14, 1979, concerning A001787, A005209, A005210, A005211</a>

%t (* 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 *)

%t 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 *)

%o (Haskell)

%o (a005211_list, a242014_list) = unzip $ (1, 1) : f 1 1 where

%o f i x | y > x = (y, i) : f (i + 1) y

%o | otherwise = f (i + 1) x

%o where y = a005210 i

%o -- _Reinhard Zumkeller_, Aug 11 2014

%Y Cf. A005210, A242014.

%K nonn,easy,nice

%O 1,2

%A _N. J. A. Sloane_

%E More terms from _David W. Wilson_