login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A037454 a(n) = Sum_{i=0..m} d(i)*6^i, where Sum_{i=0..m} d(i)*3^i is the base 3 representation of n. 6
0, 1, 2, 6, 7, 8, 12, 13, 14, 36, 37, 38, 42, 43, 44, 48, 49, 50, 72, 73, 74, 78, 79, 80, 84, 85, 86, 216, 217, 218, 222, 223, 224, 228, 229, 230, 252, 253, 254, 258, 259, 260, 264, 265, 266, 288, 289, 290, 294, 295, 296, 300, 301, 302, 432, 433, 434, 438 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Clark Kimberling, Table of n, a(n) for n = 0..1000

FORMULA

From Peter Bala, Dec 01 2016: (Start)

a(n) = n + 1/2*Sum_{k >= 1} 6^k*floor(n/3^k). Cf. A037462, A007091 and A102491.

a(0) = 0; a(n) = 6*a(n/3) if n == 0 (mod 3) else a(n) = a(n-1) + 1. (End)

MAPLE

seq(n + (1/2)*add(6^k*floor(n/3^k), k = 1..floor(ln(n)/ln(3))), n = 1..100); # Peter Bala, Dec 01 2016

MATHEMATICA

t = Table[FromDigits[RealDigits[n, 3], 6], {n, 0, 100}]

(* Clark Kimberling, Aug 03 2012 *)

PROG

(Julia)

function a(n)

    m, r, b = n, 0, 1

    while m > 0

        m, q = divrem(m, 3)

        r += b * q

        b *= 6

    end

r end; [a(n) for n in 0:57] |> println # Peter Luschny, Jan 03 2021

CROSSREFS

Cf. A037462, A007091, A102491.

Sequence in context: A080333 A194369 A039592 * A189242 A285160 A287321

Adjacent sequences:  A037451 A037452 A037453 * A037455 A037456 A037457

KEYWORD

nonn,base,easy

AUTHOR

Clark Kimberling

EXTENSIONS

Offset changed to 0 by Clark Kimberling, Aug 03 2012

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 July 24 06:56 EDT 2021. Contains 346273 sequences. (Running on oeis4.)