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

A130835 Sum of all numbers having n or fewer digits and having the sum of their digits equal to n.

Original entry on oeis.org

1, 33, 1110, 38885, 1399986, 51333282, 1906666476, 71499999285, 2701111108410, 102631111100848, 3917722222183045, 150126888888738762, 5771538888888311735, 222499777777775552780, 8598259999999991401740, 332968856666666633369781, 12918171566666666537484951
Offset: 1

Views

Author

J. M. Bergot, Jul 18 2007

Keywords

Examples

			Take n = 3. The numbers to be summed are 111, 3, 30, 300, 210, 201, 120, 102, 21 and 12, which add to 1110.
		

Crossrefs

Programs

  • Maple
    A007953 := proc(n) add(i,i=convert(n,base,10)) ; end: A130835 := proc(n) local a,i; a := 0 ; for i from 1 to 10^n-1 do if A007953(i) = n then a := a+i ; fi ; od ; RETURN(a) ; end: seq(A130835(n),n=1..4) ; # R. J. Mathar, Aug 01 2007
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i=0, 0, add(b(n-j, i-1), j=0..min(n, 9))))
        end:
    a:= n-> b(n, n)*(10^n-1)/9:
    seq(a(n), n=1..20); # Alois P. Heinz, Nov 02 2009

Formula

a(n) = (10^n-1)/9 * [x^n] ((x^10-1)/(x-1))^n. - Alois P. Heinz, Feb 07 2012
a(n) = A000042(n) * A167403(n) = A002275(n) * A167403(n). - Alois P. Heinz, Aug 16 2018

Extensions

a(4)-a(6) from R. J. Mathar, Aug 01 2007
a(7)-a(12) from Donovan Johnson, Jul 02 2009
More terms from Alois P. Heinz, Nov 02 2009

A331672 Sum of all base-n numbers with digit sum n and length at most n.

Original entry on oeis.org

3, 91, 2635, 94501, 4254936, 234572213, 15403880115, 1176838159861, 102631111100848, 10063085278250005, 1095923297151849530, 131253123286275198027, 17145216226230367266330, 2425892898650501790637545, 369599184391990522425455939, 60326656013944234430010524773
Offset: 2

Views

Author

Alois P. Heinz, Feb 22 2020

Keywords

Comments

The cardinality of these numbers is given by A048775(n-1).

Examples

			a(2) = 3 = 11_2.
a(3) = 91 = 5 + 7 + 11 + 13 + 15 + 19 + 21 = 12_3 + 21_3 + 102_3 + 111_3 + 120_3 + 201_3 + 210_3.
a(10) = A130835(10) = 102631111100848.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, [1, 0],
          `if`(i=0, 0, add((p->[p[1], p[2]*k+p[1]*d])(
             b(n-d, i-1, k)), d=0..min(n, k-1))))
        end:
    a:= n-> b(n$3)[2]:
    seq(a(n), n=2..17);
    # second Maple program:
    a:= n-> (binomial(2*n-1, n)-n)*(n^n-1)/(n-1):
    seq(a(n), n=2..17);

Formula

a(n) = A048775(n-1)*A023037(n) = (binomial(2*n-1,n)-n)*(n^n-1)/(n-1).
Showing 1-2 of 2 results.