0,4

Daniel Forgues, Table of n, a(n) for n = 0..100000

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

(Python)

def a065363(n):

s=0

x=0

while n>0:

x=n%3

n=n/3

if x==2:

x=-1

n+=1

s+=x

return s

l=[0]

for n in range(1, 101): l+=[l[n - 1] + a065363(n), ]

print l # Indranil Ghosh, Jun 07 2017

Cf. A003462, A065363, A140267.

Sequence in context: A299920 A137363 A110549 * A161413 A201049 A303354

Adjacent sequences: A174571 A174572 A174573 * A174575 A174576 A174577

nonn,base

Daniel Forgues, Mar 23 2010

approved