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

%I #19 Jan 03 2021 15:38:22

%S 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,

%T 85,86,216,217,218,222,223,224,228,229,230,252,253,254,258,259,260,

%U 264,265,266,288,289,290,294,295,296,300,301,302,432,433,434,438

%N 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.

%H Clark Kimberling, <a href="/A037454/b037454.txt">Table of n, a(n) for n = 0..1000</a>

%F From _Peter Bala_, Dec 01 2016: (Start)

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

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

%p 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

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

%t (* _Clark Kimberling_, Aug 03 2012 *)

%o (Julia)

%o function a(n)

%o m, r, b = n, 0, 1

%o while m > 0

%o m, q = divrem(m, 3)

%o r += b * q

%o b *= 6

%o end

%o r end; [a(n) for n in 0:57] |> println # _Peter Luschny_, Jan 03 2021

%Y Cf. A037462, A007091, A102491.

%K nonn,base,easy

%O 0,3

%A _Clark Kimberling_

%E Offset changed to 0 by _Clark Kimberling_, Aug 03 2012

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 April 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)