%I #14 Jan 31 2021 16:42:03
%S 1,3,18,38,195,585,607,3948,11976,42415,127921,56067,666938,2082798,
%T 10769251,22610393,110616780,315726436,408228944,2384863439,
%U 7159829169,23350950650,74348867826,49863537606,401947783347,1296027221145,6159163094580,13796041908620,60717334308629,181812784262527
%N a(n) is the sum of (3^n mod 2^k) for k such that 2^k < 3^n.
%C a(n) == A056576(n) (mod 2).
%H Robert P. P. McKone, <a href="/A337921/b337921.txt">Table of n, a(n) for n = 1..1000</a>
%e a(3) = (3^3 mod 2^1) + (3^3 mod 2^2) + (3^3 mod 2^3) + (3^3 mod 2^4) = 18.
%p f:= proc(n) local k; add(3 &^ n mod 2^k, k = 1 .. ilog2(3^n)) end proc:
%p map(f, [$1..100]);
%t A337921[n_] := Sum[Mod[3^n, 2^k], {k, 1, Floor[n*Log[2, 3]]}]; Table[A337921[n], {n, 1, 30}] (* _Robert P. P. McKone_, Jan 31 2021 *)
%o (PARI) a(n) = sum(k=1, logint(3^n, 2), lift(Mod(3, 2^k)^n)); \\ _Michel Marcus_, Jan 30 2021
%Y Cf. A056576.
%K nonn
%O 1,2
%A _J. M. Bergot_ and _Robert Israel_, Jan 29 2021