A061076 a(n) is the sum of the products of the digits of all the numbers from 1 to n.
1, 3, 6, 10, 15, 21, 28, 36, 45, 45, 46, 48, 51, 55, 60, 66, 73, 81, 90, 90, 92, 96, 102, 110, 120, 132, 146, 162, 180, 180, 183, 189, 198, 210, 225, 243, 264, 288, 315, 315, 319, 327, 339, 355, 375, 399, 427, 459, 495, 495, 500, 510, 525, 545, 570, 600, 635
Offset: 1
Examples
a(9) = a(10) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1*0 = 1+2+3+4+5+6+7+8+9 = 45.
References
- Amarnath Murthy, Smarandache friendly numbers and a few more sequences, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.
Links
- Daria Micovic, Table of n, a(n) for n = 1..10000
- Amarnath Murthy, Smarandache friendly numbers and a few more sequences, vixra, 2014.
- Luca Onnis, On the general Smarandache's sigma product of digits, arXiv:2203.07227 [math.GM], 2022.
Programs
-
Maple
A007954:= n -> convert(convert(n,base,10),`*`): ListTools:-PartialSums(map(A007954,[$1..100])); # Robert Israel, May 17 2016
-
Mathematica
Accumulate[Times@@IntegerDigits[#]& /@ Range[100]]
-
PARI
pd(n) = my(d = digits(n)); prod(i=1, #d, d[i]); a(n) = sum(k=1, n, pd(k)); \\ Michel Marcus, Feb 01 2015
-
PARI
a(n) = {n=digits(n); p=1; d=#n; for(i=1,#n,if(n[i]==0,d=i-1;break)); (45/44) * (45^(#n-1)-1) + sum(i=1,d,p*=n[i]; p * (n[i]-1) * (45/44) * (45^(#n -i) - 45^(#n-i-1)) / 2)+p*(d==#n)} \\ David A. Corneth, May 17 2016
-
Python
from math import prod def A061076(n): return sum(prod(int(d) for d in str(i)) for i in range(1,n+1)) # Chai Wah Wu, Mar 21 2022
-
Sage
def A061076(n): p = 0 i = 0 while i < n + 1: p += prod(int(digit) for digit in str(i)) i += 1 return p # Daria Micovic, Apr 13 2016
Formula
a(n) = Sum_{k = 1..n} (product of the digits of k).
a(10^k-1) = (45/44)*(45^k-1). - Giovanni Resta, Oct 18 2012
From Robert Israel, May 17 2016: (Start)
Partial sums of A007954.
G.f.: (1-x)^(-1) * Sum_{n>=0} Product_{j=0..n} Sum_{k=1..9} k * x^(k*10^j).
G.f. satisfies A(x) = (x + 2*x^2 + ... + 9*x^9)*(1+(1-x^10)*A(x^10))/(1-x).
(End)
Let b(1), b(2), ..., b(k) be the digits of the base-10 expansion of n: n = b(1)*10^(k-1) + b(2)*10^(k-2) + ... + b(k). Then a(n) = b(1)*b(2)*...*b(k) + (45^k-45)/44 + (1/2)*Sum_{i=1..k} b(1)*b(2)*...*b(i)*(b(i)-1)*45^(k-i). - Mihai Teodor, Apr 09 2022
Extensions
Corrected and extended by Matthew Conroy, Apr 16 2001
Comments