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!)
A043262 Sum of digits of n-th base 3 palindrome. 0
0, 1, 2, 2, 4, 2, 3, 4, 4, 5, 6, 2, 4, 6, 4, 6, 8, 2, 3, 4, 4, 5, 6, 6, 7, 8, 4, 5, 6, 6, 7, 8, 8, 9, 10, 2, 4, 6, 4, 6, 8, 6, 8, 10, 4, 6, 8, 6, 8, 10, 8, 10, 12, 2, 3, 4, 4, 5, 6, 6, 7, 8, 4, 5, 6, 6, 7, 8, 8, 9, 10, 6, 7, 8, 8, 9, 10, 10, 11, 12, 4, 5, 6, 6, 7, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
MATHEMATICA
Total/@Select[IntegerDigits[Range[0, 2000], 3], #==Reverse[#]&] (* Harvey P. Dale, Aug 08 2019 *)
PROG
(Python)
from gmpy2 import digits
def A043262(n):
if n == 1: return 0
y = 3*(x:=3**(len(digits(n>>1, 3))-1))
return int((s:=digits(n-x, 3))[-1])+(sum(int(d) for d in s[:-1])<<1) if n<x+y else sum(map(int, digits(n-y, 3)))<<1 # Chai Wah Wu, Jul 24 2024
CROSSREFS
Cf. A014190 (base 3 palindromes)
Sequence in context: A103274 A046820 A356878 * A130860 A161535 A138785
KEYWORD
nonn,base,changed
AUTHOR
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 July 27 12:02 EDT 2024. Contains 374647 sequences. (Running on oeis4.)