[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS 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
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
Sequence in context: A080333 A194369 A039592 * A189242 A285160 A362462
KEYWORD
nonn,base,easy
AUTHOR
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 29 11:15 EDT 2024. Contains 375512 sequences. (Running on oeis4.)