[go: up one dir, main page]

login
Interpret the values of the Moebius function mu(k) for k = 1 to n as a balanced ternary number.
5

%I #36 May 19 2021 16:47:44

%S 0,1,2,5,15,44,133,398,1194,3582,10747,32240,96720,290159,870478,

%T 2611435,7834305,23502914,70508742,211526225,634578675,1903736026,

%U 5711208079,17133624236,51400872708,154202618124,462607854373,1387823563119,4163470689357

%N Interpret the values of the Moebius function mu(k) for k = 1 to n as a balanced ternary number.

%C Balanced ternary is much like regular ternary, but with the crucial difference of using the digit -1 instead of the digit 2. Then some powers of 3 are added, others are subtracted.

%C If mu(n) = 0, then a(n) is a multiple of 3, specifically, it is thrice a(n - 1). Otherwise, a(n) is not a multiple of 3.

%H Alois P. Heinz, <a href="/A292524/b292524.txt">Table of n, a(n) for n = 0..2097</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Balanced_ternary">Balanced ternary</a>

%F a(n) = Sum_{k = 1..n} mu(k) 3^(n - k).

%F a(n) = 3 * a(n-1) + mu(n) for n > 0. - _Alois P. Heinz_, Oct 13 2017

%F a(n) ~ A238271 * 3^n. - _Vaclav Kotesovec_, May 19 2021

%e mu(1) = 1, so a(1) = 1 * 3^0 = 1.

%e mu(2) = -1, so a(2) = 1 * 3^1 + -1 * 3^0 = 3 - 1 = 2.

%e mu(3) = -1, so a(3) = 1 * 3^2 + -1 * 3^1 + -1 * 3^0 = 9 - 3 - 1 = 5.

%e mu(4) = 0, so a(4) = 1 * 3^3 + -1 * 3^2 + -1 * 3^1 + 0 * 3^0 = 27 - 9 - 3 + 0 = 15.

%p a:= proc(n) option remember; `if`(n=0, 0,

%p a(n-1)*3+numtheory[mobius](n))

%p end:

%p seq(a(n), n=0..33); # _Alois P. Heinz_, Oct 13 2017

%t Table[Plus@@(3^Range[n - 1, 0, -1] MoebiusMu[Range[n]]), {n, 50}]

%o (PARI) a(n) = sum(k=1, n, moebius(k)*3^(n-k)); \\ _Michel Marcus_, Oct 01 2017

%o (PARI) my(N=40, x='x+O('x^N)); concat(0, Vec(sum(k=1, N, moebius(k)*x^k)/(1-3*x))) \\ _Seiichi Manyama_, May 19 2021

%o (PARI) a(n) = if(n==0, 0, 3*a(n-1)+moebius(n)); \\ _Seiichi Manyama_, May 19 2021

%Y Cf. A008683, A238271, A292779, A344432, A344433.

%K nonn,easy,base

%O 0,3

%A _Alonso del Arte_, Sep 18 2017

%E a(0)=0 prepended by _Alois P. Heinz_, Oct 13 2017