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.

A081927 n-th positive integer whose digits sum up to n.

Original entry on oeis.org

1, 11, 21, 31, 41, 51, 61, 71, 81, 109, 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, 97889, 178899, 199798, 298988, 398988
Offset: 1

Views

Author

Amarnath Murthy, Apr 01 2003

Keywords

Examples

			31 is the 4th integer of the sequence and the 4th number whose digits sum up to 4 : 4, 13, 22, [31], 103, 112, 121, 130, ...
109 is the 10th integer of the sequence and the 10th number whose digits sum up to 10 : 19, 28, 37, 46, 55, 64, 73, 82, 91, [109], 118, 127, 136, ...
		

Crossrefs

Leading diagonal of A081926.

Programs

  • Maple
    f:= proc(n) local Res, d, v, count;
        count:= 0;
        for d from ceil(n/9) while count < n do
           v:= g(n,d,n-count,1);
           Res:= v[-1];
           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:
    map(f, [$1..200]); # Robert Israel, Feb 19 2018
  • Mathematica
    Table[Select[Range[500000],Total[IntegerDigits[#]]==n&][[n]],{n,45}] (* Harvey P. Dale, Mar 02 2024 *)

Formula

From Robert Israel, Feb 20 2018: (Start)
a(9*k-j) = (12-j)*10^(k-1) - 10^(k-10) - 10^(j+k-45) - 1 for j=2..9, k >= 45-j.
a(9*k-1) = 2*10^k - 10^(k-9) - 10^(k-35) - 1, k >= 35. (End)

Extensions

Corrected and extended by Ray Chandler, Oct 29 2003

A083678 Numbers m = d_1 d_2 ... d_k (in base 10) with properties that k is even and d_i + d_{k+1-i} = 10 for all i.

Original entry on oeis.org

19, 28, 37, 46, 55, 64, 73, 82, 91, 1199, 1289, 1379, 1469, 1559, 1649, 1739, 1829, 1919, 2198, 2288, 2378, 2468, 2558, 2648, 2738, 2828, 2918, 3197, 3287, 3377, 3467, 3557, 3647, 3737, 3827, 3917, 4196, 4286, 4376, 4466, 4556, 4646, 4736, 4826, 4916
Offset: 1

Views

Author

Zak Seidov Jun 15 2003

Keywords

Comments

The two-digit terms here occur in many sequences, e.g., A066686, A081926, A017173, A030108, A043457, A052224, A061388, A084364.

Examples

			1469 and 6284 are members because 1+9=4+6=10 and 6+4=2+8=10.
		

Crossrefs

Programs

  • Mathematica
    ok10Q[n_]:=Module[{idn=IntegerDigits[n]},idn[[1]]+idn[[4]]==idn[[2]]+idn[[3]]==10]; Join[ Select[ Range[10,99],Total[IntegerDigits[#]]==10&],Select[Range[1000,9999],ok10Q]] (* Harvey P. Dale, Oct 14 2023 *)
  • PARI
    isok(n) = {digs = digits(n); if (#digs % 2 == 0, for (i = 1, #digs/2, if ((digs[i] + digs[#digs+1-i]) ! = 10, return (0));); return (1);); return (0);} \\ Michel Marcus, Oct 05 2013

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

A332046 a(n) is the smallest positive integer such that there exist exactly n positive integers less than a(n) whose digital sum in base 10 is equal to the digital sum of a(n).

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 90, 108, 117, 126, 135, 144, 153, 162, 171, 180, 207, 216, 225, 234, 243, 252, 261, 270, 280, 307, 316, 325, 334, 343, 352, 361, 370, 406, 415, 424, 433, 442, 451, 460, 470, 506, 515, 524, 533, 542, 551, 560, 605, 614, 623, 632, 641, 650, 660
Offset: 1

Views

Author

Arnauld Chevallier, Feb 06 2020

Keywords

Examples

			For n=10, 108 is the smallest positive integer for which there exists exactly 10 smaller integers whose digit sum in base 10 is the same as the digit sum of 108 (i.e., 1+0+8=9). These integers are 9, 18, 27, 36, 45, 54, 63, 72, 81, 90.
		

Crossrefs

Cf. A081926 (similar but different definition).

Programs

  • PARI
    isok(k, n) = {my(v=vector(k, j, sumdigits(j))); #select(x->(x==v[k]), v) == n+1;}
    a(n) = {my(k=1); while(! isok(k, n), k++); k;} \\ Michel Marcus, Feb 16 2020
Showing 1-4 of 4 results.