cp's OEIS Frontend

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.

A358509 Sum of decimal digits of (3^n - 1)/2 (A003462).

This page as a plain text file.
%I A358509 #35 Nov 30 2022 00:02:01
%S A358509 0,1,4,4,4,4,13,13,13,22,22,31,22,31,31,31,22,31,31,31,31,31,49,49,40,
%T A358509 40,49,67,58,58,58,76,58,76,85,85,85,85,94,85,85,94,103,103,85,94,103,
%U A358509 112,103,112,130,130,94,121,112,112,121,103,103,121,112,121,121,139,121,148,121,157,157,157,157,175,157,157
%N A358509 Sum of decimal digits of (3^n - 1)/2 (A003462).
%C A358509 a(n) == 4 (mod 9) for n >= 2. - _Robert Israel_, Nov 21 2022
%H A358509 Michel Marcus, <a href="/A358509/b358509.txt">Table of n, a(n) for n = 0..5000</a>
%F A358509 a(n) = A007953(A003462(n)).
%e A358509 For n=5, (3^n - 1)/2 = 121 so that a(5) = 1+2+1 = 4.
%p A358509 seq(convert(convert((3^n-1)/2,base,10),`+`),n=0..100); # _Robert Israel_, Nov 21 2022
%t A358509 a[n_] := Total[IntegerDigits[(3^n - 1)/2]]; Array[a, 100, 0] (* _Amiram Eldar_, Nov 20 2022 *)
%o A358509 (PARI) a(n) = sumdigits((3^n - 1)/2); \\ _Michel Marcus_, Nov 20 2022
%o A358509 (Python)
%o A358509 def A358509(n): return sum(map(int,str((3**n-1)>>1))) # _Chai Wah Wu_, Nov 21 2022
%Y A358509 Cf. A003462, A007953, A017209.
%Y A358509 Cf. A004166 (of 3^n).
%K A358509 nonn,base,easy
%O A358509 0,3
%A A358509 _Paul Curtz_, Nov 20 2022