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.

A292995 Sum of digits of 3^n (A004166) divided by 9.

This page as a plain text file.
%I A292995 #20 Sep 08 2022 08:46:19
%S A292995 0,0,1,1,1,1,2,2,2,3,3,3,2,3,5,4,3,3,5,4,5,3,5,6,6,7,7,9,8,8,7,9,7,8,
%T A292995 11,9,9,10,10,9,10,11,10,12,10,11,12,14,13,12,16,13,13,15,12,10,10,12,
%U A292995 14,13,11,15,17,17,16,15,13,18,17,17,16,20,18,17,19,20,17,18
%N A292995 Sum of digits of 3^n (A004166) divided by 9.
%C A292995 All terms A004166(n), n >= 2, are multiples of 9.
%C A292995 For the first two terms, the (zero) integer part of the fractional values (1/9 and 3/9) is taken: This seems to be the most natural extension of the maybe more natural variant of this sequence which would start only at offset n = 2.
%C A292995 Divisibility of A004166(n) by any prime different from 3 is equivalent to divisibility of a(n) by that prime. For example, indices of terms of A004166 divisible by 7, listed in A292931, are also exactly the indices > 1 of terms a(n) divisible by 7.
%H A292995 Chai Wah Wu, <a href="/A292995/b292995.txt">Table of n, a(n) for n = 0..10000</a>
%p A292995 0,0,seq(convert(convert(3^n,base,10),`+`)/9, n=2..100); # _Robert Israel_, Sep 28 2017
%t A292995 Rest[Table[Sum[DigitCount[(3^n)][[i]] i, {i, 9}] / 9, {n, 100}]] (* _Vincenzo Librandi_, Sep 28 2017 *)
%o A292995 (PARI) a(n)=sumdigits(3^n)\9
%o A292995 (Magma) [n lt 2 select 0 else &+Intseq(3^n)/9: n in [0..100]]; // _Vincenzo Librandi_, Sep 28 2017
%o A292995 (Python)
%o A292995 from __future__ import division
%o A292995 def A292995(n):
%o A292995     return sum(int(d) for d in str(3**n))//9 # _Chai Wah Wu_, Sep 28 2017
%Y A292995 Cf. A004166, A292931.
%K A292995 nonn,base
%O A292995 0,7
%A A292995 _M. F. Hasler_, Sep 27 2017