cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A337921 a(n) is the sum of (3^n mod 2^k) for k such that 2^k < 3^n.

Original entry on oeis.org

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

Views

Author

J. M. Bergot and Robert Israel, Jan 29 2021

Keywords

Comments

a(n) == A056576(n) (mod 2).

Examples

			a(3) = (3^3 mod 2^1) + (3^3 mod 2^2) + (3^3 mod 2^3) + (3^3 mod 2^4) = 18.
		

Crossrefs

Cf. A056576.

Programs

  • 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 *)
  • PARI
    a(n) = sum(k=1, logint(3^n, 2), lift(Mod(3, 2^k)^n)); \\ Michel Marcus, Jan 30 2021