This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A346972 #36 Oct 15 2023 16:05:24 %S A346972 1,4,2,1,3,6,0,3,7,10,4,3,5,1,9,10,8,12,4,20,10,7,13,1,25,4,18,19,17, %T A346972 21,13,29,31,27,35,19,13,25,1,8,36,23,5,41,15,20,10,30,40,20,8,32,38, %U A346972 26,50,2,40,23,57,50,2,35,33,37,29,45,13,8,18,69,39,26 %N A346972 a(1)=1, a(2)=4, a(n) = (n*a(n-1) - (n-1)*a(n-2)) mod (n+1). %C A346972 Goes as high as 2917 before settling to a final value of 77 for all n >= 2982. %H A346972 <a href="/index/Con#constant">Index entries for eventually constant sequences</a> %H A346972 <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1). %F A346972 a(n) = 77 for n >= 2982. %t A346972 a[1] = 1; a[2] = 4; a[n_] := a[n] = Mod[n*a[n - 1] - (n - 1)*a[n - 2], n + 1]; Array[a, 100] (* _Amiram Eldar_, Aug 10 2021 *) %t A346972 nxt[{n_,a_,b_}]:={n+1,b,Mod[b(n+1)-n*a,n+2]}; NestList[nxt,{2,1,4},80][[;;,2]] (* _Harvey P. Dale_, Oct 15 2023 *) %o A346972 (PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = 4; for (n=3, nn, va[n] = (n*va[n-1] - (n-1)*va[n-2]) % (n+1);); va;} \\ _Michel Marcus_, Aug 10 2021 %K A346972 nonn,easy %O A346972 1,2 %A A346972 _Steven M. Altschuld_, Aug 09 2021