login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A337921
a(n) is the sum of (3^n mod 2^k) for k such that 2^k < 3^n.
1
1, 3, 18, 38, 195, 585, 607, 3948, 11976, 42415, 127921, 56067, 666938, 2082798, 10769251, 22610393, 110616780, 315726436, 408228944, 2384863439, 7159829169, 23350950650, 74348867826, 49863537606, 401947783347, 1296027221145, 6159163094580, 13796041908620, 60717334308629, 181812784262527
OFFSET
1,2
COMMENTS
a(n) == A056576(n) (mod 2).
LINKS
EXAMPLE
a(3) = (3^3 mod 2^1) + (3^3 mod 2^2) + (3^3 mod 2^3) + (3^3 mod 2^4) = 18.
MAPLE
f:= proc(n) local k; add(3 &^ n mod 2^k, k = 1 .. ilog2(3^n)) end proc:
map(f, [$1..100]);
MATHEMATICA
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 *)
PROG
(PARI) a(n) = sum(k=1, logint(3^n, 2), lift(Mod(3, 2^k)^n)); \\ Michel Marcus, Jan 30 2021
CROSSREFS
Cf. A056576.
Sequence in context: A097989 A039700 A069147 * A365442 A094159 A138976
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jan 29 2021
STATUS
approved