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-8 of 8 results.

A007954 Product of decimal digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

R. Muller

Keywords

Comments

Moebius transform of A093811(n). a(n) = A093811(n) * A008683(n), where operation * denotes Dirichlet convolution, namely b(n) * c(n) = Sum_{d|n} b(d) * c(n/d). Simultaneously holds Dirichlet multiplication: a(n) * A000012(n) = A093811(n). - Jaroslav Krizek, Mar 22 2009
Apart from the 0's, all terms are in A002473. Further, for all m in A002473 there is some n such that a(n) = m, see A096867. - Charles R Greathouse IV, Sep 29 2013
a(n) = 0 asymptotically almost surely, namely for all n except for the set of numbers without digit '0'; this set is of density zero, since it is less and less probable to have no '0' as the number of digits of n grows. (See also A054054.) - M. F. Hasler, Oct 11 2015

Crossrefs

Cf. A031347 (different from A035930), A007953, A007602, A010888, A093811, A008683, A000012, A061076 (partial sums), A230099.
Cf. A051802 (ignoring zeros).

Programs

  • Haskell
    a007954 n | n < 10 = n
              | otherwise = m * a007954 n' where (n', m) = divMod n 10
    -- Reinhard Zumkeller, Oct 26 2012, Mar 14 2011
    
  • Magma
    [0] cat [&*Intseq(n): n in [1..110]]; // Vincenzo Librandi, Jan 03 2020
    
  • Maple
    A007954 := proc(n::integer)
        if n = 0 then
            0;
        else
            mul( d,d=convert(n,base,10)) ;
        end if;
    end proc: # R. J. Mathar, Oct 02 2019
  • Mathematica
    Array[Times @@ IntegerDigits@ # &, 108, 0] (* Robert G. Wilson v, Mar 15 2011 *)
  • PARI
    A007954(n)= { local(resul = n % 10); n \= 10; while( n > 0, resul *= n %10; n \= 10; ); return(resul); } \\ R. J. Mathar, May 23 2006, edited by M. F. Hasler, Apr 23 2015
    
  • PARI
    A007954(n)=prod(i=1,#n=Vecsmall(Str(n)),n[i]-48) \\ (...eval(Vec(...)),n[i]) is about 50% slower; (...digits(n)...) about 6% slower. \\ M. F. Hasler, Dec 06 2009
    
  • PARI
    a(n)=if(n,factorback(digits(n)),0) \\ Charles R Greathouse IV, Apr 14 2020
    
  • Python
    from math import prod
    def a(n): return prod(map(int, str(n)))
    print([a(n) for n in range(108)]) # Michael S. Branicky, Jan 16 2022
  • Scala
    (0 to 99).map(.toString.toCharArray.map( - 48).scanRight(1)( * ).head) // Alonso del Arte, Apr 14 2020
    

Formula

A000035(a(A014261(n))) = 1. - Reinhard Zumkeller, Nov 30 2007
a(n) = abs(A187844(n)). - Reinhard Zumkeller, Mar 14 2011
a(n) > 0 if and only if A054054(n) > 0. a(n) = d in {1, ..., 9} if n = (10^k - 1)/9 + (d - 1)*10^m = A002275(k) + (d - 1)*A011557(m) for some k > m >= 0. The statement holds with "if and only if" for d in {1, 2, 3, 5, 7}. For d = 4, 6, 8 or 9, one has a(n) = d if n = (10^k - 1)/9 + (a - 1)*10^m + (b - 1)*10^p with integers k > m > p >= 0 and a, b > 0 such that d = a*b. - M. F. Hasler, Oct 11 2015
From Robert Israel, May 17 2016: (Start)
G.f.: 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 + A(x^10)). (End)
a(n) <= 9^(1 + log_10(n/9)). - Lucas A. Brown, Jun 22 2023

Extensions

Error in term 25 corrected, Nov 15 1995

A061077 a(n) is the sum of the products of the digits of the first n odd numbers.

Original entry on oeis.org

1, 4, 9, 16, 25, 26, 29, 34, 41, 50, 52, 58, 68, 82, 100, 103, 112, 127, 148, 175, 179, 191, 211, 239, 275, 280, 295, 320, 355, 400, 406, 424, 454, 496, 550, 557, 578, 613, 662, 725, 733, 757, 797, 853, 925, 934, 961, 1006, 1069, 1150, 1150, 1150, 1150
Offset: 1

Views

Author

Amarnath Murthy, Apr 14 2001

Keywords

Examples

			a(7) = 1 + 3 + 5 + 7 + 9 + 1*1 + 1*3 = 29.
		

References

  • Amarnath Murthy, Smarandache friendly numbers and a few more sequences, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.

Crossrefs

Programs

  • Mathematica
    Accumulate[Times @@@ IntegerDigits[Range[1, 99, 2]]] (* Luca Onnis, Mar 20 2022 *)
  • PARI
    pd(n) = my(d = digits(n)); prod(i=1, #d, d[i]);
    a(n) = sum(k=1, n, pd(2*k-1)); \\ Michel Marcus, Feb 01 2015
    
  • PARI
    a(n) = {m=digits(2*n - 1); p=1; d=#m; for(i=1, #m, if(m[i]==0, d=i-1; break));
    (25/44) * (45^(#m-1)-1) + sum(i=1, #m-1, (prod(j=1,#m-i-1,m[j])) * (m[#m-i]) * (m[#m-i]-1) * (5^(i + 1) * 9^(i-1)) / 2)+prod(k=1,#m-1,m[k])*(((m[#m]+1)^2)/4)} \\ Luca Onnis, Mar 20 2022
    
  • Python
    from math import prod
    def A061077(n): return sum(prod(int(d) for d in str(2*i+1)) for i in range(n)) # Chai Wah Wu, Mar 21 2022

Formula

a(n) = Sum_{k = 1..n} (product of the digits of 2k-1).
From Luca Onnis, Mar 20 2022: (Start)
a(5*10^n) = (25/44)*(45^(n+1)-1).
a(n) <= (25/44)*(45^(log(n/5)+1)-1) for all n.
a(n) ~ (5/4)*A061078(n) as n -> infinity. (End)

Extensions

More terms from Matthew Conroy, Apr 16 2001
Offset corrected by Charles R Greathouse IV, Feb 01 2015
Incorrect formula removed by Luca Onnis, Mar 20 2022

A061078 Sum of the products of the digits of the first n positive even numbers.

Original entry on oeis.org

2, 6, 12, 20, 20, 22, 26, 32, 40, 40, 44, 52, 64, 80, 80, 86, 98, 116, 140, 140, 148, 164, 188, 220, 220, 230, 250, 280, 320, 320, 332, 356, 392, 440, 440, 454, 482, 524, 580, 580, 596, 628, 676, 740, 740, 758, 794, 848, 920, 920, 920, 920, 920, 920, 920, 922
Offset: 1

Views

Author

Amarnath Murthy, Apr 14 2001

Keywords

Comments

For n = (10^r)/2, a(n) is the sum of the r terms of the geometric progression with first term 20 and common ratio 45.

Examples

			a(5) = 2 + 4 + 6 + 8 + 1*0 = 20; (a(18)=116, not 114).
a(1199) = a(5^2*2^4*3 - 1) = ... = a(5^2*2^4*3 + 5) = a(1205). In fact, the number of "fives" is exactly equal to 1 = 2-1 (where 2 is the exponent of 5).
		

References

  • Amarnath Murthy, Smarandache friendly numbers and a few more sequences, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.

Crossrefs

Programs

  • Mathematica
    Accumulate[Times@@@IntegerDigits[Range[2,120,2]]] (* Harvey P. Dale, Jun 18 2021 *)
  • PARI
    pd(n) = my(d = digits(n)); prod(i=1, #d, d[i]);
    a(n) = sum(k=1, n, pd(2*k)); \\ Michel Marcus, Feb 01 2015
    
  • PARI
    a(n) = sum(k=1, n, vecprod(digits(2*k))); \\ Michel Marcus, Mar 13 2022
    
  • PARI
    a(n) = {t=digits(2*n); p=1; d=#t; for(i=1, #t, if(t[i]==0, d=i-1; break));
    (5/11) * (45^(#t-1)-1) + (sum(i=1, #t-1, ((prod(j=1,#t-i-1,t[j])) * (t[#t-i]) * (t[#t-i]-1) * 2 * (5^(i))* (9^(i-1)))))+(prod(k=1,#t-1,t[k]))*((((t[#t])^2))/4+(t[#t])/2)} \\ Luca Onnis, Mar 17 2022
    
  • Python
    from math import prod
    from itertools import accumulate
    def p(n): return prod(map(int, str(n)))
    def a(n): return sum(p(2*i) for i in range(1, n+1))
    def aupton(nn): return list(accumulate([pd(2*k) for k in range(1, nn+1)]))
    print(aupton(56)) # Michael S. Branicky, Mar 13 2022

Formula

From Luca Onnis, Mar 13 2022: (Start)
a(5*10^n-1) = a(5*10^n) = (5/11)*(45^(n+1)-1).
a(n) <= (5/11)*(45^(log((n+1)/5)+1)-1) for all n.
a(n) ~ (4/5)*A061077(n) as n -> infinity.
Conjecture: let a >= 1, b >= 0, where p is not a multiple of 2 nor 5. Then:
a(5^a*2^b*p-1) = a(5^a*2^b*p) = ... = a(5^a*2^b*p + 55...5) where the number of fives is equal to b if a > b, and is equal to a-1 if 1 <= a <= b. (End)

Extensions

Corrected and extended by Matthew Conroy, Apr 17 2001
Incorrect formula removed by Luca Onnis, Mar 13 2022
Name clarified by Chai Wah Wu, Mar 21 2022

A187845 Partial sums of A187844.

Original entry on oeis.org

0, -1, -3, -6, -10, -15, -21, -28, -36, -45, -45, -44, -42, -39, -35, -30, -24, -17, -9, 0, 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 90, 93, 99, 108, 120, 135, 153, 174, 198, 225, 225, 229, 237, 249, 265, 285, 309, 337, 369, 405, 405, 410, 420, 435, 455, 480, 510, 545, 585, 630, 630, 636, 648, 666
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 14 2011

Keywords

Crossrefs

Cf. A061076.

Programs

  • Haskell
    a187845 n = a187845_list !! (n-1)
    a187845_list = scanl1 (+) $ map a187844 [0..]
    -- Reinhard Zumkeller, Jan 29 2014

A217627 a(n) is the sum of the products of the nonzero digits of the numbers from 1 to n.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 46, 47, 49, 52, 56, 61, 67, 74, 82, 91, 93, 95, 99, 105, 113, 123, 135, 149, 165, 183, 186, 189, 195, 204, 216, 231, 249, 270, 294, 321, 325, 329, 337, 349, 365, 385, 409, 437, 469, 505, 510, 515, 525, 540, 560, 585, 615, 650
Offset: 1

Views

Author

Giovanni Resta, Oct 18 2012

Keywords

Comments

The formula a(10^k) = 46^k can be easily derived from the Multinomial Theorem, inspecting the expansion of (1+1+2+3+...+9)^k, where the second '1's takes the place of '0' (since we are neglecting the zeros in the products). This formula can be generalized as follows:
Let B>1 be the base used for representation. Let D be a subset of {1,2,...,B-1}. Using base B, let A(n) be the sum of the products of the digits in D of the numbers up to n. Then, A(B^k)=(B+S-|D|)^k, where |D| is the cardinality of D and S is the sum of the elements of D. For example, in base 10, with D={1,3,5,7,9}, (i.e., A(n)= sum of the products of the odd digits of the numbers up to n) we have A(k)=(10+(1+3+5+7+9)-5)^k = 30^k.

Examples

			a(10) = 1+2+3+4+5+6+7+8+9+1 = 46
		

Crossrefs

Cf. A061076 (the same sum, when zeros are taken into account).

Programs

  • Mathematica
    pp[n_]:=Times@@Select[IntegerDigits[n],#>0 &]; Accumulate[pp /@ Range[100]]

Formula

a(10^k) = 46^k.

A352346 Common terms between A061078 and A061077.

Original entry on oeis.org

26, 52, 148, 280, 320, 454, 1150, 1480, 8000, 41650, 80300, 165656, 166088, 614900, 2353700, 2859460, 28233200, 66130400, 68941640, 85717240, 107300320, 131507080, 155478800, 207666520, 1426680920, 1824596800, 2468014900, 2475648820, 5342351060, 5355218900, 5857281500, 8550475900, 36025361120
Offset: 1

Views

Author

Luca Onnis, Mar 12 2022

Keywords

Comments

Smarandache's conjecture: there are infinitely many terms.
This is a subsequence of A061076.

Examples

			26 is a term of this sequence, in fact:
26 = 1+3+5+7+9+1*1 (A061077(6)=26);
26 = 2+4+6+8+1*0+1*2+1*4 (A061078(7)=26).
		

References

  • A. Murthy, Smarandache friendly numbers and a few more sequences, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001. Page 267

Crossrefs

Programs

  • Mathematica
    Intersection[Accumulate[Times @@@ IntegerDigits[Range[2, 10000000, 2]]],
    Accumulate[Times @@@ IntegerDigits[Range[1, 10000000, 2]]]]
  • Python
    from math import prod
    from itertools import islice
    def A352346_gen(): # generator of terms
        n1, m1, n2, m2 = 1, 1, 2, 2
        while True:
            if m1 == m2:
                yield m1
            k = 0
            while k == 0:
                n1 += 2
                m1 += (k := prod(int(d) for d in str(n1)))
            while m2 < m1:
                n2 += 2
                m2 += prod(int(d) for d in str(n2))
    A352346_list = list(islice(A352346_gen(),20)) # Chai Wah Wu, Mar 21 2022

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.

A350744 Numbers m such that A061078(m)/A061077(m) = 4/5.

Original entry on oeis.org

5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 51, 52, 53, 54, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 101, 102, 103, 104, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 151, 152, 153, 154, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 201, 202, 203, 204, 205, 210, 215, 220, 225
Offset: 1

Views

Author

Luca Onnis, Mar 20 2022

Keywords

Comments

All positive multiples of 5 are terms of the sequence.

Examples

			30 is a term, in fact A061078(30)=320, A061077(30)=400 and a(n) = 320/400 = is 4/5.
500, 501, 502, ..., 554, 555 are all terms. In fact 500=5*10^2 and for the formula above also 501, ..., 500+(5/9)*(10^2-1) = 555 are all terms of the sequence.
		

References

  • Amarnath Murthy, Smarandache friendly numbers and a few more sequences, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.

Crossrefs

Programs

  • Mathematica
    Flatten[Position[(Accumulate[Times @@@ IntegerDigits[Range[2, 10000, 2]]]/
        Accumulate[Times @@@ IntegerDigits[Range[1, 9999, 2]]]), 4/5]]
  • PARI
    pd(n) = my(d = digits(n)); prod(i=1, #d, d[i]);
    isok(k) = sum(i=1, k, pd(2*i))/sum(i=1, k, pd(2*i-1)) == 4/5; \\ Michel Marcus, Mar 21 2022

Formula

Let k be a positive integer not divisible by 5 and j >= 0; then 5*k*10^j, 5*k*10^j+1, ..., 5*k*10^j+(5/9)*(10^j-1) are all terms of the sequence.
Limit_{n->oo} A061078(n)/A061077(n) = 4/5.
Showing 1-8 of 8 results.