|
|
A261010
|
|
Write 5^n in base 3, add up the "digits".
|
|
2
|
|
|
1, 3, 5, 7, 7, 9, 9, 13, 15, 13, 13, 17, 19, 21, 21, 27, 25, 25, 25, 23, 27, 33, 31, 39, 35, 45, 37, 57, 45, 47, 45, 45, 53, 47, 55, 51, 57, 59, 67, 67, 69, 65, 67, 65, 71, 79, 71, 65, 67, 75, 65, 71, 73, 83, 69, 79, 81, 85, 79, 89, 87, 95, 89, 85, 97, 99, 93, 101, 107
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
MAPLE
|
S:=n->add(i, i in convert(5^n, base, 3)); [seq(S(n), n=0..100)];
|
|
PROG
|
(Python)
def digits(n, b=10): # digits of n in base 2 <= b <= 62
x, y = n, ''
while x >= b:
x, r = divmod(x, b)
y += str(r) if r < 10 else (chr(r+87) if r < 36 else chr(r+29))
y += str(x) if x < 10 else (chr(x+87) if x < 36 else chr(x+29))
return y[::-1]
return sum([int(d) for d in digits(5**n, 3)]) # Chai Wah Wu, Aug 14 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|