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.

Showing 1-3 of 3 results.

A094345 Sum of all digits in ternary expansions of 0, ..., n.

Original entry on oeis.org

0, 1, 3, 4, 6, 9, 11, 14, 18, 19, 21, 24, 26, 29, 33, 36, 40, 45, 47, 50, 54, 57, 61, 66, 70, 75, 81, 82, 84, 87, 89, 92, 96, 99, 103, 108, 110, 113, 117, 120, 124, 129, 133, 138, 144, 147, 151, 156, 160, 165, 171, 176, 182, 189, 191, 194, 198, 201, 205, 210, 214, 219
Offset: 0

Views

Author

Benoit Cloitre, Jun 08 2004

Keywords

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic sequences, Cambridge University Press, 2003, p. 94.

Crossrefs

Programs

  • Mathematica
    a[n_] := Plus @@ IntegerDigits[n, 3]; Accumulate @ Array[a, 60, 0] (* Amiram Eldar, Dec 09 2021 *)
  • PARI
    s(k,n)=n-(k-1)*sum(m=1,n,valuation(m,k));
    a(n)=sum(i=0,n,s(3,i))
    
  • PARI
    a(n)= sum(i=1, n, sumdigits(i, 3)); \\ Ruud H.G. van Tol, Nov 19 2024

Formula

Asymptotically: a(n) = n*log(n)/log(3) + n*F(log(n)/log(3)) where F is a continuous function of period 1 nowhere differentiable (see Allouche & Shallit book).

A231503 a(n) = Sum_{i=0..n} digsum_3(i)^2, where digsum_3(i) = A053735(i).

Original entry on oeis.org

0, 1, 5, 6, 10, 19, 23, 32, 48, 49, 53, 62, 66, 75, 91, 100, 116, 141, 145, 154, 170, 179, 195, 220, 236, 261, 297, 298, 302, 311, 315, 324, 340, 349, 365, 390, 394, 403, 419, 428, 444, 469, 485, 510, 546, 555, 571, 596, 612, 637, 673, 698, 734, 783, 787, 796, 812, 821, 837, 862, 878, 903, 939, 948, 964, 989, 1005, 1030, 1066, 1091, 1127, 1176, 1192, 1217, 1253, 1278
Offset: 0

Views

Author

N. J. A. Sloane, Nov 13 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate @ (Table[Plus @@ IntegerDigits[n, 3], {n, 0, 75}]^2) (* Amiram Eldar, Jan 20 2022 *)
  • PARI
    a(n) = sum(i=0, n, sumdigits(i, 3)^2); \\ Michel Marcus, Sep 20 2017

A231504 a(n) = Sum_{i=0..n} digsum_3(i)^3, where digsum_3(i) = A053735(i).

Original entry on oeis.org

0, 1, 9, 10, 18, 45, 53, 80, 144, 145, 153, 180, 188, 215, 279, 306, 370, 495, 503, 530, 594, 621, 685, 810, 874, 999, 1215, 1216, 1224, 1251, 1259, 1286, 1350, 1377, 1441, 1566, 1574, 1601, 1665, 1692, 1756, 1881, 1945, 2070, 2286, 2313, 2377, 2502, 2566, 2691, 2907, 3032, 3248, 3591, 3599, 3626, 3690, 3717, 3781, 3906, 3970, 4095, 4311, 4338, 4402, 4527, 4591, 4716
Offset: 0

Views

Author

N. J. A. Sloane, Nov 13 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate @ Array[(Plus @@ IntegerDigits[#, 3])^3 &, 70, 0] (* Amiram Eldar, Jan 20 2022 *)
  • PARI
    a(n) = sum(i=0, n, sumdigits(i, 3)^3); \\ Michel Marcus, Sep 20 2017
Showing 1-3 of 3 results.