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 A346502 #29 May 06 2022 13:13:51 %S A346502 0,2,4,8,10,12,16,18,20,26,28,30,34,36,38,42,44,46,52,54,56,60,62,64, %T A346502 68,70,72,80,82,84,88,90,92,96,98,100,106,108,110,114,116,118,122,124, %U A346502 126,132,134,136,140,142,144,148,150,152,160,162,164,168,170,172 %N A346502 a(n) = 3n - (sum of digits of 3n in base 3). %C A346502 Terms of A344853 without repetition. %C A346502 All terms are even. %C A346502 A new largest gap between 2 consecutive terms is obtained between a(3^m-1) and a(3^m), m >= 0 (see formula). %C A346502 In base 2, A005187(n) = 2n - (sum of digits of 2n in base 2) is also the exponent of the largest power of 2 dividing (2n)!, but here the exponent of the largest power of 3 dividing (3n)! is not a(n) but A004128(n). %F A346502 a(n) = 3*n - A053735(3*n). %F A346502 a(n) = 2*A004128(n). %F A346502 a(n) = A344853(3n). %F A346502 a(3^n) - a(3^n-1) = 2*(n+1). %e A346502 a(8) = 24 - (sum of digits of 24 in base 3); 24_10 = 220_3 and 2+2+0 = 4, so a(8) = 24-4 = 20. %t A346502 a[n_] := 3*n - Plus @@ IntegerDigits[3*n, 3]; Array[a, 100, 0] (* _Amiram Eldar_, Jul 22 2021 *) %o A346502 (PARI) a(n) = 3*n - sumdigits(n,3); \\ _Kevin Ryde_, Jul 21 2021 %o A346502 (Python) %o A346502 from sympy.ntheory.digits import digits %o A346502 def a(n): return 3*n - sum(digits(3*n, 3)[1:]) %o A346502 print([a(n) for n in range(60)]) # _Michael S. Branicky_, Jul 28 2021 %Y A346502 Cf. A005187 (similar, with base 2). %Y A346502 Cf. A004128, A053735, A344853. %K A346502 nonn,base %O A346502 0,2 %A A346502 _Bernard Schott_, Jul 21 2021