The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358509 Sum of decimal digits of (3^n - 1)/2 (A003462). 2
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, 40, 49, 67, 58, 58, 58, 76, 58, 76, 85, 85, 85, 85, 94, 85, 85, 94, 103, 103, 85, 94, 103, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(n) == 4 (mod 9) for n >= 2. - Robert Israel, Nov 21 2022
LINKS
FORMULA
a(n) = A007953(A003462(n)).
EXAMPLE
For n=5, (3^n - 1)/2 = 121 so that a(5) = 1+2+1 = 4.
MAPLE
seq(convert(convert((3^n-1)/2, base, 10), `+`), n=0..100); # Robert Israel, Nov 21 2022
MATHEMATICA
a[n_] := Total[IntegerDigits[(3^n - 1)/2]]; Array[a, 100, 0] (* Amiram Eldar, Nov 20 2022 *)
PROG
(PARI) a(n) = sumdigits((3^n - 1)/2); \\ Michel Marcus, Nov 20 2022
(Python)
def A358509(n): return sum(map(int, str((3**n-1)>>1))) # Chai Wah Wu, Nov 21 2022
CROSSREFS
Cf. A004166 (of 3^n).
Sequence in context: A046109 A294246 A107680 * A285052 A369719 A369757
KEYWORD
nonn,base,easy
AUTHOR
Paul Curtz, Nov 20 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 7 22:01 EDT 2024. Contains 373206 sequences. (Running on oeis4.)