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 A004493 #21 Dec 27 2023 08:31:34 %S A004493 4,5,3,7,8,6,1,2,0,13,14,12,16,17,15,10,11,9,22,23,21,25,26,24,19,20, %T A004493 18,31,32,30,34,35,33,28,29,27,40,41,39,43,44,42,37,38,36,49,50,48,52, %U A004493 53,51,46,47,45,58,59,57,61 %N A004493 Tersum n + 4. %H A004493 <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,1,-1). %F A004493 Tersum m + n: write m and n in base 3 and add mod 3 with no carries; e.g., 5 + 8 = "21" + "22" = "10" = 1. %t A004493 LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {4, 5, 3, 7, 8, 6, 1, 2, 0, 13, 14}, 80] (* _Jinyuan Wang_, Mar 10 2020 *) %o A004493 (Python) %o A004493 def tersum(a, b): %o A004493 c, pow3 = 0, 1 %o A004493 while a + b > 0: %o A004493 a, ra = divmod(a, 3) %o A004493 b, rb = divmod(b, 3) %o A004493 c, pow3 = c + pow3*((ra+rb)%3), pow3*3 %o A004493 return c %o A004493 def a(n): return tersum(n, 4) %o A004493 print([a(n) for n in range(58)]) # _Michael S. Branicky_, Apr 05 2021 %o A004493 (PARI) my(table=[4,4,1,4,4,1,-5,-5,-8]); a(n) = n + table[n%9+1]; \\ _Kevin Ryde_, Apr 05 2021 %Y A004493 Cf. A004489 (tersum array). %K A004493 nonn,easy %O A004493 0,1 %A A004493 _N. J. A. Sloane_