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 A071770 #27 Aug 07 2024 14:19:38 %S A071770 0,1,2,4,5,3,8,6,7,12,13,14,16,17,15,11,9,10,24,25,26,19,20,18,23,21, %T A071770 22,36,37,38,40,41,39,44,42,43,48,49,50,52,53,51,47,45,46,33,34,35,28, %U A071770 29,27,32,30,31,72,73,74,76,77,75,80,78,79,57,58,59,61,62,60,56,54,55,69,70 %N A071770 Tersum n + [n/3] (answer recorded in base 10). %H A071770 Alois P. Heinz, <a href="/A071770/b071770.txt">Table of n, a(n) for n = 0..19682</a> %H A071770 P. Mathonet, M. Rigo, M. Stipulanti and N. Zénaïdi, <a href="https://arxiv.org/abs/2201.06636">On digital sequences associated with Pascal's triangle</a>, arXiv:2201.06636 [math.NT], 2022. %H A071770 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the nonnegative integers</a> %F A071770 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. See A004482 for references. %p A071770 a:= n-> (l-> add(irem(l[i]+l[i-1], 3)*3^(i-2), %p A071770 i=2..nops(l)))([convert(n, base, 3)[], 0]): %p A071770 seq(a(n), n=0..73); # _Alois P. Heinz_, Aug 07 2024 %o A071770 (PARI) a(n)={if(n==0, 0, fromdigits((digits(n,3) + concat([0],digits(n\3,3)))%3,3))} \\ _Andrew Howroyd_, Aug 06 2024 %o A071770 (Python) %o A071770 from sympy.ntheory import digits %o A071770 def a(n): %o A071770 d = digits(n, 3)[1:] %o A071770 return int(str(d[0]) + "".join(str((d[i]+d[i-1])%3) for i in range(1, len(d))), 3) %o A071770 print([a(n) for n in range(75)]) # _Michael S. Branicky_, Aug 07 2024 %Y A071770 Cf. A004482. %Y A071770 Inverse permutation to A370932. %K A071770 nonn,look %O A071770 0,3 %A A071770 _Paul D. Hanna_, Jun 04 2002 %E A071770 a(27) corrected by _Sean A. Irvine_, Aug 06 2024