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.

A360365 a(n) = sum of the products of the digits of the first n positive multiples of 3.

Original entry on oeis.org

3, 9, 18, 20, 25, 33, 35, 43, 57, 57, 66, 84, 111, 119, 139, 171, 176, 196, 231, 231, 249, 285, 339, 353, 388, 444, 452, 484, 540, 540, 567, 621, 702, 702, 702, 702, 703, 707, 714, 714, 720, 732, 750, 756, 771, 795, 799, 815, 843, 843, 858, 888, 933, 945, 975, 1023, 1030, 1058, 1107
Offset: 1

Views

Author

Luca Onnis, Feb 09 2023

Keywords

Examples

			a(4) = 20 since the first 4 positive multiples of 3 are 3,6,9 and 12 and the sum of the product of their digits is 3 + 6 + 9 + 1*2 = 20.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Times @@@ IntegerDigits[Range[3, 999 , 3]]]
  • PARI
    a(n)={sum(k=1, n, vecprod(digits(3*k)))} \\ Andrew Howroyd, Feb 09 2023
    
  • Python
    from math import prod
    def A360365(n): return sum(prod(int(d) for d in str(m)) for m in range(3,3*n+1,3)) # Chai Wah Wu, Feb 28 2023

Formula

a((10^n-1)/3) = (1/836)*(15*(19*45^n-63) + 44*3^((3*n)/2)*(sqrt(3)*sin((Pi*n)/6) + 15*cos((Pi*n)/6))).
G.f. of the subsequence a((10^n-1)/3): 9*(2 - 32*x + 135*x^2)/((1 - x)*(1 - 45*x)*(1 - 9*x + 27*x^2)).
a((10^n-1)/3) = 55*a((10^(n-1)-1)/3) - 486*a((10^(n-2)-1)/3) + 1647*a((10^(n-3)-1)/3) - 1215*a((10^(n-4)-1)/3) for n > 4.