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

A081926 Triangle read by rows in which n-th row gives n smallest numbers with digit sum n.

Original entry on oeis.org

1, 2, 11, 3, 12, 21, 4, 13, 22, 31, 5, 14, 23, 32, 41, 6, 15, 24, 33, 42, 51, 7, 16, 25, 34, 43, 52, 61, 8, 17, 26, 35, 44, 53, 62, 71, 9, 18, 27, 36, 45, 54, 63, 72, 81, 19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 29, 38, 47, 56, 65, 74, 83, 92, 119, 128, 137
Offset: 1

Views

Author

Amarnath Murthy, Apr 01 2003

Keywords

Examples

			Triangle starts
1
2 11
3 12 21
4 13 22 31
5 14 23 32 41
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local Res, d, v, count;
        Res:= NULL; count:= 0;
        for d from ceil(n/9) while count < n do
           v:= g(n,d,n-count,1);
           Res:= Res, op(v);
           count:= count + nops(v);
        od:
        Res
    end proc:
    g:= proc(n,d,remain) local rem, Res, j, j0, v;
          if remain = 0 then return [] else rem:= remain fi;
          if nargs = 4 then j0:= 1 else j0:= 0 fi;
          if d = 1 then if n >= j0 and n <= 9 then [n] else [] fi
          else
            Res:= NULL;
            for j from max(j0, ceil(n-9*(d-1))) to min(9,n) while rem > 0 do
              v:= map(t -> j*10^(d-1)+t, procname(n-j,d-1,rem));
              Res:= Res, op(v);
              rem:= rem - nops(v);
            od;
            [Res]
          fi
    end proc:
    for i from 1 to 25 do f(i) od; # Robert Israel, Feb 19 2018
  • Mathematica
    Needs["Combinatorica`"]; Table[Take[Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 6]], {s, Partitions[n, 9]}]]], n], {n, 40}] (* T. D. Noe, Mar 08 2013 *)

A181178 n-th zerofree positive number with digital sum n.

Original entry on oeis.org

1, 11, 21, 31, 41, 51, 61, 71, 81, 118, 137, 165, 193, 257, 294, 376, 467, 567, 676, 785, 894, 1399, 1778, 1986, 2887, 3869, 4869, 5878, 6887, 7896, 8959, 9968, 18798, 26998, 35999, 45999, 56899, 66989, 76998, 87799
Offset: 1

Views

Author

Jonathan Vos Post, Jan 25 2011

Keywords

Comments

n-th value in n-th row of triangular array A069800 in which n-th row consists of numbers (excluding the digit 0) with digit sum n arranged in increasing numerical order.
For n > 376, a(n) has decimal representation xyy...y, where x = (n+1) mod 9 + 1, and among y's exactly two equal 8 and the rest equal 9. For example, a(377) = 1999999998999999999999999999999999989999999. - Max Alekseyev, Aug 20 2013

Examples

			a(1) = 1 because 1 is the 1st number with digital sum 1;
a(2) = 11 because 11 is the 2nd number with digital sum 2 {2,11};
a(3) = 21 because 21 is the 3rd (zerofree positive) number with digital sum 3 {3,12,21,111};
a(4) = 31 because 31 is the 4th (zerofree positive) number with digital sum 4 {4,13,22,31,112,121,211,1111}.
		

Crossrefs

Programs

  • Mathematica
    nn=50; c=Table[0,{nn}]; t=c; cnt=0; n=0; While[cnt
    				

A081928 Sum of the n smallest numbers having the sum of their digits equal to n.

Original entry on oeis.org

1, 13, 36, 70, 115, 171, 238, 316, 405, 604, 868, 1197, 1591, 2158, 2844, 3829, 5140, 6939, 9415, 12100, 14994, 18493, 26062, 34650, 49414, 69535, 96534, 129412, 164299, 201195, 240154, 281122, 414036, 584635, 852634, 1212633, 1629532
Offset: 1

Views

Author

Amarnath Murthy, Apr 01 2003

Keywords

Comments

Sum of n-th row of A081926.

Examples

			The two smallest numbers with digit sum 2 are 2 and 11, whose sum is 13.
For seven, 7+16+25+34+43+52+61=238.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{}, co = 0; in = 1; su = 0; While[co < n, If[Plus @@ IntegerDigits[in] == n, co++; su = su + in]; in++ ]; su]; Table[a[n], {n, 1, 30}] (Steinerberger)

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 19 2003
Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

A263019 If n is the i-th positive integer with digital sum j, then a(n) is the j-th positive integer with digital sum i.

Original entry on oeis.org

1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 2, 11, 20, 101, 110, 200, 1001, 1010, 1100, 1000000000, 12, 21, 30, 102, 111, 120, 201, 210, 2000, 10000000000, 22, 31, 40, 103, 112, 121, 130, 300, 10001, 100000000000, 32, 41, 50, 104, 113, 122
Offset: 1

Views

Author

Paul Tek, Oct 07 2015

Keywords

Comments

Digital sum is given by A007953.
This is a self-inverse permutation of the natural numbers, with fixed points A081927.
A007953(n) = A081927(a(n)) for any n>0.
A081927(n) = A007953(a(n)) for any n>0.
a(A051885(n)) = 10^(n-1) for any n>0.
a(10^(n-1)) = A051885(n) for any n>0.

Crossrefs

Programs

  • PARI
    a(n) = {j = sumdigits(n); v = vector(n, k, sumdigits(k)); i = #select(x->x==j, v); nb = 0; k = 0; while(nb != j, k++; if (sumdigits(k) == i, nb++)); k;} \\ Michel Marcus, Oct 16 2015
Showing 1-4 of 4 results.