login
a(n) = A000120(A292590(n)).
3

%I #11 Sep 23 2017 19:14:47

%S 0,0,1,1,0,2,2,1,3,3,1,4,0,0,5,5,2,2,5,2,6,6,1,7,0,3,8,1,3,9,9,1,3,9,

%T 4,10,10,0,3,10,0,11,2,5,12,1,5,4,12,2,13,13,2,14,14,5,15,3,2,4,0,6,1,

%U 15,6,16,2,1,17,17,7,4,4,0,18,18,3,6,18,8,5,18,1,19,0,3,20,1,9,21,21,9,6,1,1,22,22,3,23,23,9,4,5,4,5

%N a(n) = A000120(A292590(n)).

%C Locate the node which contains n in binary tree A245612 (or in its mirror-image A244154) and traverse from that node towards the root, counting all multiples of three that occur on the path. More formally, for n > 1, a(n) counts the multiples of 3 encountered until 1 is reached, when we iterate the map x -> A285712(x), starting from x=n. The count includes also n itself if it is a multiple of 3.

%H Antti Karttunen, <a href="/A292594/b292594.txt">Table of n, a(n) for n = 1..8505</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%F a(1) = 0; and for n > 1, a(n) = A079978(n) + a(A285712(n)).

%F a(n) = A000120(A292590(n)).

%F a(n) + A292595(n) = A285715(n).

%t f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; a[n_] := a[n] = If[n == 1, n - 1, 2 a[f@ n] + Boole[Divisible[n, 3]]]; Array[DigitCount[a@ #, 2, 1] &, 105] (* _Michael De Vlieger_, Sep 22 2017 *)

%o (definec (A292594 n) (if (<= n 1) 0 (+ (if (zero? (modulo n 3)) 1 0) (A292594 (A285712 n)))))

%Y Cf. A000120, A244154, A245612, A285712, A285715, A292590, A292595.

%K nonn

%O 1,6

%A _Antti Karttunen_, Sep 20 2017