login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A244040 Sum of digits of n in fractional base 3/2. 16
0, 1, 2, 2, 3, 4, 3, 4, 5, 3, 4, 5, 5, 6, 7, 4, 5, 6, 5, 6, 7, 7, 8, 9, 5, 6, 7, 5, 6, 7, 7, 8, 9, 8, 9, 10, 5, 6, 7, 7, 8, 9, 6, 7, 8, 7, 8, 9, 9, 10, 11, 9, 10, 11, 5, 6, 7, 7, 8, 9, 8, 9, 10, 6, 7, 8, 8, 9, 10, 8, 9, 10, 9, 10, 11, 11, 12, 13, 10, 11, 12, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

The base 3/2 expansion is unique, and thus the sum of digits function is well-defined.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

EXAMPLE

In base 3/2 the number 7 is represented by 211 and so a(7) = 2 + 1 + 1 = 4.

MATHEMATICA

a[n_]:= a[n]= If[n==0, 0, a[2*Floor[n/3]] + Mod[n, 3]]; Table[a[n], {n, 0, 85}] (* G. C. Greubel, Aug 20 2019 *)

PROG

(Sage)

def base32sum(n):

    L, i = [n], 1

    while L[i-1]>2:

        x=L[i-1]

        L[i-1]=x.mod(3)

        L.append(2*floor(x/3))

        i+=1

    return sum(L)

[base32sum(n) for n in [0..85]]

(Haskell)

a244040 0 = 0

a244040 n = a244040 (2 * n') + t where (n', t) = divMod n 3

-- Reinhard Zumkeller, Sep 05 2014

CROSSREFS

Cf. A024629, A007953, A000120, A053735, A244041.

Cf. A024629, A246435, A053735.

Sequence in context: A285325 A135529 A061282 * A064514 A112342 A256094

Adjacent sequences:  A244037 A244038 A244039 * A244041 A244042 A244043

KEYWORD

nonn,base

AUTHOR

James Van Alstine, Jun 17 2014

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 12:18 EDT 2019. Contains 328160 sequences. (Running on oeis4.)