OFFSET
0,4
LINKS
Daniel Forgues, Table of n, a(n) for n = 0..100000
FORMULA
a(0) = 0, a(n) = a(n-1) + A065363(n), n >= 1.
a(n) <= n with equality iff n belongs to A003462. - Rémy Sigrist, Oct 05 2019
PROG
(Python)
def a065363(n):
s=0
x=0
while n>0:
x=n%3
n//=3
if x==2:
x=-1
n+=1
s+=x
return s
l=[0]
for n in range(1, 101): l.append(l[n - 1] + a065363(n))
print(l) # Indranil Ghosh, Jun 07 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Daniel Forgues, Mar 23 2010
STATUS
approved