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-10 of 30 results. Next

A052216 Sums of two powers of 10.

Original entry on oeis.org

2, 11, 20, 101, 110, 200, 1001, 1010, 1100, 2000, 10001, 10010, 10100, 11000, 20000, 100001, 100010, 100100, 101000, 110000, 200000, 1000001, 1000010, 1000100, 1001000, 1010000, 1100000, 2000000, 10000001, 10000010, 10000100, 10001000, 10010000, 10100000, 11000000, 20000000
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

Numbers whose digit sum is 2.
A007953(a(n)) = 2; number of repdigits = #{2,11} = A242627(2) = 2. - Reinhard Zumkeller, Jul 17 2014
By extension, numbers k such that digitsum(k)^2 - 1 is prime. (PROOF: For any number k whose digit sum d > 2, d^2 - 1 = (d+1)*(d-1) and thus is not prime.) - Christian N. K. Anderson, Apr 22 2024

Examples

			From _Bruno Berselli_, Mar 07 2013: (Start)
The triangular array starts (see formula):
        2;
       11,      20;
      101,     110,     200;
     1001,    1010,    1100,    2000;
    10001,   10010,   10100,   11000,   20000;
   100001,  100010,  100100,  101000,  110000,  200000;
  1000001, 1000010, 1000100, 1001000, 1010000, 1100000, 2000000;
  ...
(End)
		

Crossrefs

Subsequence of A069263 and A107679. A038444 is a subsequence.
Sums of n powers of 10: A011557 (1), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052216 n = a052216_list !! (n-1)
    a052216_list = 2 : f [2] 9 where
       f xs@(x:_) z = ys ++ f ys (10 * z) where
                      ys = (x + z) : map (* 10) xs
    -- Reinhard Zumkeller, Jan 28 2015, Jul 17 2014
    
  • Magma
    [n: n in [1..10100000] | &+Intseq(n) eq 2]; // Vincenzo Librandi, Mar 07 2013
    
  • Magma
    /* As a triangular array: */ [[10^n+10^m: m in [0..n]]: n in [0..8]]; // Bruno Berselli, Mar 07 2013
    
  • Mathematica
    t = 10^Range[0, 9]; Select[Union[Flatten[Table[i + j, {i, t}, {j, t}]]], # <= t[[-1]] + 1 &] (* T. D. Noe, Oct 09 2011 *)
    With[{nn=7},Sort[Join[Table[FromDigits[PadRight[{2},n,0]],{n,nn}], FromDigits/@Flatten[Table[Table[Insert[PadRight[{1},n,0],1,i]],{n,nn},{i,2,n+1}],1]]]] (* Harvey P. Dale, Nov 15 2011 *)
    Select[Range[10^9], Total[IntegerDigits[#]] == 2&] (* Vincenzo Librandi, Mar 07 2013 *)
    T[n_,k_]:=10^(n-1)+10^(k-1); Table[T[n,k],{n,8},{k,n}]//Flatten (* Stefano Spezia, Nov 03 2023 *)
  • PARI
    a(n)=my(d=(sqrtint(8*n)-1)\2,t=n-d*(d+1)/2-1); 10^d + 10^t \\ Charles R Greathouse IV, Dec 19 2016
    
  • Python
    from itertools import count, islice
    def agen(): yield from (10**i + 10**j for i in count(0) for j in range(i+1))
    print(list(islice(agen(), 34))) # Michael S. Branicky, May 15 2022
    
  • Python
    from math import isqrt
    def A052216(n): return 10**(a:=(k:=isqrt(m:=n<<1))+(m>k*(k+1))-1)+10**(n-1-(a*(a+1)>>1)) # Chai Wah Wu, Apr 08 2025
    
  • SageMath
    def A052216(n,k): return 10^(n-1) + 10^(k-1)
    flatten([[A052216(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Feb 22 2024

Formula

T(n,k) = 10^(n-1) + 10^(k-1) with 1 <= k <= n.
a(n) = 3*A237424(n) - 1. - Reinhard Zumkeller, Jan 28 2015
a(n) = 10^A003056(n-1) + 10^A002262(n-1). - Chai Wah Wu, Apr 08 2025

A052224 Numbers whose sum of digits is 10.

Original entry on oeis.org

19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 118, 127, 136, 145, 154, 163, 172, 181, 190, 208, 217, 226, 235, 244, 253, 262, 271, 280, 307, 316, 325, 334, 343, 352, 361, 370, 406, 415, 424, 433, 442, 451, 460, 505, 514, 523, 532, 541, 550, 604, 613, 622, 631, 640
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

Proper subsequence of A017173. - Rick L. Shepherd, Jan 12 2009
Subsequence of A227793. - Michel Marcus, Sep 23 2013
A007953(a(n)) = 10; number of repdigits = #{55,22222,1^10} = A242627(10) = 3. - Reinhard Zumkeller, Jul 17 2014
a(n) = A094677(n) for n = 1..28. - Reinhard Zumkeller, Nov 08 2015
The number of terms having <= m digits is the coefficient of x^10 in sum(i=0,9,x^i)^m = ((1-x^10)/(1-x))^m. - David A. Corneth, Jun 04 2016
In general, the set of numbers with sum of base-b digits equal to b is a subset of { (b-1)*k + 1; k = 2, 3, 4, ... }. - M. F. Hasler, Dec 23 2016

Crossrefs

Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A166311 (11), A235151 (12), A143164 (13), A235225 (14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).
Cf. A094677.
Sum of base-b digits equal b: A226636 (b = 3), A226969 (b = 4), A227062 (b = 5), A227080 (b = 6), A227092 (b = 7), A227095 (b = 8), A227238 (b = 9).

Programs

  • Haskell
    a052224 n = a052224_list !! (n-1)
    a052224_list = filter ((== 10) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..1000] | &+Intseq(n) eq 10 ]; // Vincenzo Librandi, Mar 10 2013
    
  • Maple
    sd := proc (n) options operator, arrow: add(convert(n, base, 10)[j], j = 1 .. nops(convert(n, base, 10))) end proc: a := proc (n) if sd(n) = 10 then n else end if end proc: seq(a(n), n = 1 .. 800); # Emeric Deutsch, Jan 16 2009
  • Mathematica
    Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 7]], {s, Rest[IntegerPartitions[10]]}]]] (* T. D. Noe, Mar 08 2013 *)
    Select[Range[1000], Total[IntegerDigits[#]] == 10 &] (* Vincenzo Librandi, Mar 10 2013 *)
  • PARI
    isok(n) = sumdigits(n) == 10; \\ Michel Marcus, Dec 28 2015
    
  • PARI
    \\ This algorithm needs a modified binomial.
    C(n, k)=if(n>=k, binomial(n, k), 0)
    \\ ways to roll s-q with q dice having sides 0 through n - 1.
    b(s, q, n)=if(s<=q*(n-1), s+=q; sum(i=0, q-1, (-1)^i*C(q, i)*C(s-1-n*i, q-1)), 0)
    \\ main algorithm; this program applies to all sequences of the form "Numbers whose sum of digits is m."
    a(n,{m=10}) = {my(q); q = 2; while(b(m, q, 10) < n, q++); q--; s = m; os = m; r=0; while(q, if(b(s, q, 10) < n, n-=b(s, q, 10); s--, r+=(os-s)*10^(q); os = s; q--)); r+= s; r}
    \\ David A. Corneth, Jun 05 2016
    
  • Python
    from sympy.utilities.iterables import multiset_permutations
    def auptodigs(maxdigits, b=10, sod=10): # works for any base, sum-of-digits
        alst = [sod] if 0 <= sod < b else []
        nzdigs = [i for i in range(1, b) if i <= sod]
        nzmultiset = []
        for d in range(1, b):
            nzmultiset += [d]*(sod//d)
        for d in range(2, maxdigits + 1):
            fullmultiset = [0]*(d-1-(sod-1)//(b-1)) + nzmultiset
            for firstdig in nzdigs:
                target_sum, restmultiset = sod - int(firstdig), fullmultiset[:]
                restmultiset.remove(firstdig)
                for p in multiset_permutations(restmultiset, d-1):
                  if sum(p) == target_sum:
                      alst.append(int("".join(map(str, [firstdig]+p)), b))
                      if p[0] == target_sum:
                          break
        return alst
    print(auptodigs(4)) # Michael S. Branicky, Sep 14 2021
    
  • Python
    def A052224(N = 19):
        """Return a generator of the sequence of all integers >= N with the same
        digit sum as N."""
        while True:
            yield N
            N = A228915(N) # skip to next larger integer with the same digit sum
    a = A052224(); [next(a) for  in range(50)] # _M. F. Hasler, Mar 16 2022

Formula

a(n+1) = A228915(a(n)) for any n > 0. - Rémy Sigrist, Jul 10 2018

Extensions

Incorrect formula deleted by N. J. A. Sloane, Jan 15 2009
Extended by Emeric Deutsch, Jan 16 2009
Offset changed by Bruno Berselli, Mar 07 2013

A052217 Numbers whose sum of digits is 3.

Original entry on oeis.org

3, 12, 21, 30, 102, 111, 120, 201, 210, 300, 1002, 1011, 1020, 1101, 1110, 1200, 2001, 2010, 2100, 3000, 10002, 10011, 10020, 10101, 10110, 10200, 11001, 11010, 11100, 12000, 20001, 20010, 20100, 21000, 30000, 100002, 100011, 100020, 100101
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

From Joshua S.M. Weiner, Oct 19 2012: (Start)
Sequence is a representation of the "energy states" of "multiplex" notation of 3 quantum of objects in a juggling pattern.
0 = an empty site, or empty hand. 1 = one object resides in the site. 2 = two objects reside in the site. 3 = three objects reside in the site. (See A038447.) (End)
A007953(a(n)) = 3; number of repdigits = #{3,111} = A242627(3) = 2. - Reinhard Zumkeller, Jul 17 2014
Can be seen as a table whose n-th row holds the n-digit terms {10^(n-1) + 10^m + 10^k, 0 <= k <= m < n}, n >= 1. Row lengths are then (1, 3, 6, 10, ...) = n*(n+1)/2 = A000217(n). The first and the n last terms of row n are 10^(n-1) + 2 resp. 2*10^(n-1) + 10^k, 0 <= k < n. - M. F. Hasler, Feb 19 2020

Crossrefs

Cf. A007953, A218043 (subsequence).
Row n=3 of A245062.
Other digit sums: A011557 (1), A052216 (2), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).
Other bases: A014311 (binary), A226636 (ternary), A179243 (Zeckendorf).
Cf. A003056, A002262 (triangular coordinates), A056556, A056557, A056558 (tetrahedral coordinates).

Programs

  • Haskell
    a052217 n = a052217_list !! (n-1)
    a052217_list = filter ((== 3) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..100101] | &+Intseq(n) eq 3 ]; // Vincenzo Librandi, Mar 07 2013
    
  • Mathematica
    Union[FromDigits/@Select[Flatten[Table[Tuples[Range[0,3],n],{n,6}],1],Total[#]==3&]] (* Harvey P. Dale, Oct 20 2012 *)
    Select[Range[10^6], Total[IntegerDigits[#]] == 3 &] (* Vincenzo Librandi, Mar 07 2013 *)
    Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 18]], {s, IntegerPartitions[3]}]]] (* T. D. Noe, Mar 08 2013 *)
  • PARI
    isok(n) = sumdigits(n) == 3; \\ Michel Marcus, Dec 28 2015
    
  • PARI
    apply( {A052217_row(n,s,t=-1)=vector(n*(n+1)\2,k,t++>s&&t=!s++;10^(n-1)+10^s+10^t)}, [1..5]) \\ M. F. Hasler, Feb 19 2020
    
  • Python
    from itertools import count, islice
    def agen(): yield from (10**i + 10**j + 10**k for i in count(0) for j in range(i+1) for k in range(j+1))
    print(list(islice(agen(), 40))) # Michael S. Branicky, May 14 2022
    
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A052217(n): return 10**((m:=integer_nthroot(6*n,3)[0])-(a:=n<=comb(m+2,3)))+10**((k:=isqrt(b:=(c:=n-comb(m-a+2,3))<<1))-((b<<2)<=(k<<2)*(k+1)+1))+10**(c-1-comb(k+(b>k*(k+1)),2)) # Chai Wah Wu, Dec 11 2024

Formula

T(n,k) = 10^(n-1) + 10^A003056(k) + 10^A002262(k) when read as a table with row lengths n*(n+1)/2, n >= 1, 0 <= k < n*(n+1)/2. - M. F. Hasler, Feb 19 2020
a(n) = 10^A056556(n-1) + 10^A056557(n-1) + 10^A056558(n-1). - Kevin Ryde, Apr 17 2021

Extensions

Offset changed from 0 to 1 by Vincenzo Librandi, Mar 07 2013

A052218 Numbers whose sum of digits is 4.

Original entry on oeis.org

4, 13, 22, 31, 40, 103, 112, 121, 130, 202, 211, 220, 301, 310, 400, 1003, 1012, 1021, 1030, 1102, 1111, 1120, 1201, 1210, 1300, 2002, 2011, 2020, 2101, 2110, 2200, 3001, 3010, 3100, 4000, 10003, 10012, 10021, 10030, 10102, 10111, 10120, 10201, 10210, 10300
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

A007953(a(n)) = 4; number of repdigits = #{4,22,1111} = A242627(4) = 3. - Reinhard Zumkeller, Jul 17 2014

Crossrefs

Cf. A007953.
Cf. A011557 (1), A052216 (2), A052217 (3), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052218 n = a052218_list !! (n-1)
    a052218_list = filter ((== 4) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..10300] | &+Intseq(n) eq 4 ]; // Vincenzo Librandi, Mar 07 2013
    
  • Mathematica
    Select[Range[10^5], Total[IntegerDigits[#]] == 4 &] (* Vincenzo Librandi, Mar 07 2013 *)
    Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 11]], {s, IntegerPartitions[4]}]]] (* T. D. Noe, Mar 08 2013 *)
  • PARI
    isok(n) = sumdigits(n) == 4; \\ Michel Marcus, Dec 28 2015
    
  • Python
    from itertools import count, islice
    def agen(): yield from (10**i + 10**j + 10**k + 10**m for i in count(0) for j in range(i+1) for k in range(j+1) for m in range(k+1))
    print(list(islice(agen(), 45))) # Michael S. Branicky, May 15 2022

Extensions

Offset changed from Bruno Berselli, Mar 07 2013

A052221 Numbers whose sum of digits is 7.

Original entry on oeis.org

7, 16, 25, 34, 43, 52, 61, 70, 106, 115, 124, 133, 142, 151, 160, 205, 214, 223, 232, 241, 250, 304, 313, 322, 331, 340, 403, 412, 421, 430, 502, 511, 520, 601, 610, 700, 1006, 1015, 1024, 1033, 1042, 1051, 1060, 1105, 1114, 1123, 1132, 1141, 1150, 1204
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

A007953(a(n)) = 7; number of repdigits = #{7,1111111} = A242627(7) = 2. - Reinhard Zumkeller, Jul 17 2014

Crossrefs

Supersequence of A119461.
Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052221 n = a052221_list !! (n-1)
    a052221_list = filter ((== 7) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..1500] | &+Intseq(n) eq 7 ]; // Vincenzo Librandi, Mar 08 2013
    
  • Mathematica
    Select[Range[1500],Total[IntegerDigits[#]]==7&] (* Harvey P. Dale, Apr 11 2012 *)
  • Python
    def ok(n): return sum(map(int, str(n))) == 7
    print(list(filter(ok, range(1205)))) # Michael S. Branicky, Jul 16 2021
    
  • Python
    # faster version generating initial segment
    from sympy.utilities.iterables import multiset_permutations
    def auptodigs(maxdigits):
        alst = []
        for d in range(1, maxdigits+1):
            digset = "0"*(d-1) + "1111111222334567"
            for p in multiset_permutations(digset, d):
                if p[0] != '0' and sum(map(int, p)) == 7:
                    alst.append(int("".join(p)))
        return alst
    print(auptodigs(4)) # Michael S. Branicky, Jul 16 2021

Extensions

Offset changed from Bruno Berselli, Mar 07 2013

A052223 Numbers whose sum of digits is 9.

Original entry on oeis.org

9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 108, 117, 126, 135, 144, 153, 162, 171, 180, 207, 216, 225, 234, 243, 252, 261, 270, 306, 315, 324, 333, 342, 351, 360, 405, 414, 423, 432, 441, 450, 504, 513, 522, 531, 540, 603, 612, 621, 630, 702, 711, 720, 801, 810
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

Any term of this sequence with an 11 appended cannot have 11 as prime factor. See A075154. [Lekraj Beedassy, Sep 27 2009]
A007953(a(n)) = 9; number of repdigits = #{9,333,1^9} = A242627(9) = 3. - Reinhard Zumkeller, Jul 17 2014
A010872(a(n)) = A010878(a(n)) = 0. - Ilya Gutkovskiy, Jun 04 2016

Crossrefs

Cf. A007953.
Row n=9 of A245062.
Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052223 n = a052223_list !! (n-1)
    a052223_list = filter ((== 9) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
  • Magma
    [n: n in [1..1500] | &+Intseq(n) eq 9 ]; // Vincenzo Librandi, Mar 08 2013
    
  • Mathematica
    Select[Range[1500], Total[IntegerDigits[#]] == 9 &] (* Vincenzo Librandi, Mar 08 2013 *)

Extensions

More terms from Larry Reeves (Larryr(AT)acm.org), Sep 05 2000
Offset changed by Bruno Berselli, Mar 07 2013

A166311 Numbers whose sum of digits is 11.

Original entry on oeis.org

29, 38, 47, 56, 65, 74, 83, 92, 119, 128, 137, 146, 155, 164, 173, 182, 191, 209, 218, 227, 236, 245, 254, 263, 272, 281, 290, 308, 317, 326, 335, 344, 353, 362, 371, 380, 407, 416, 425, 434, 443, 452, 461, 470, 506, 515, 524, 533, 542, 551, 560, 605, 614
Offset: 1

Views

Author

Vincenzo Librandi, Oct 11 2009

Keywords

Comments

A007953(a(n)) = 11; number of repdigits = A242627(11) = 1. - Reinhard Zumkeller, Jul 17 2014

Crossrefs

Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Magma
    [n: n in [1..620] | &+Intseq(n) eq 11]; // Vincenzo Librandi, Mar 07 2013
  • Mathematica
    Select[Range[620], Total[IntegerDigits[#]] == 11&] (* Vincenzo Librandi, Mar 07 2013 *)

Extensions

Edited by N. J. A. Sloane, Oct 12 2009

A052219 Numbers whose sum of digits is 5.

Original entry on oeis.org

5, 14, 23, 32, 41, 50, 104, 113, 122, 131, 140, 203, 212, 221, 230, 302, 311, 320, 401, 410, 500, 1004, 1013, 1022, 1031, 1040, 1103, 1112, 1121, 1130, 1202, 1211, 1220, 1301, 1310, 1400, 2003, 2012, 2021, 2030, 2102, 2111, 2120, 2201, 2210, 2300, 3002
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

A007953(a(n)) = 5; number of repdigits = #{5,11111} = A242627(5) = 2. - Reinhard Zumkeller, Jul 17 2014

Crossrefs

Cf. A007953.
Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052219 n = a052219_list !! (n-1)
    a052219_list = filter ((== 5) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..3010] | &+Intseq(n) eq 5 ]; // Vincenzo Librandi, Mar 07 2013
    
  • Mathematica
    Select[Range[10^4], Total[IntegerDigits[#]] == 5 &] (* Vincenzo Librandi, Mar 07 2013 *)
    Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 9]], {s, IntegerPartitions[5]}]]] (* T. D. Noe, Mar 08 2013 *)
  • PARI
    isok(n) = sumdigits(n) == 5; \\ Michel Marcus, Dec 28 2015
    
  • Python
    from sympy.utilities.iterables import multiset_permutations
    def auptodigs(maxdigits):
      alst = [5]
      for d in range(2, maxdigits+1):
        fulldigset = list("0"*(d-1) + "1111122345")
        for firstdig in "12345":
          target_sum, restdigset = 5-int(firstdig), fulldigset[:]
          restdigset.remove(firstdig)
          for p in multiset_permutations(restdigset, d-1):
            if sum(map(int, p)) == target_sum:
              alst.append(int(firstdig+"".join(p)))
              if int(p[0]) == target_sum: break
      return alst
    print(auptodigs(4)) # Michael S. Branicky, May 14 2021

Extensions

Offset changed from Bruno Berselli, Mar 07 2013

A052222 Numbers whose sum of digits is 8.

Original entry on oeis.org

8, 17, 26, 35, 44, 53, 62, 71, 80, 107, 116, 125, 134, 143, 152, 161, 170, 206, 215, 224, 233, 242, 251, 260, 305, 314, 323, 332, 341, 350, 404, 413, 422, 431, 440, 503, 512, 521, 530, 602, 611, 620, 701, 710, 800, 1007, 1016, 1025, 1034, 1043, 1052, 1061
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

A007953(a(n)) = 8; number of repdigits = #{8,44,2222,1^8} = A242627(8) = 4. - Reinhard Zumkeller, Jul 17 2014

Crossrefs

Cf. A007953.
Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052222 n = a052222_list !! (n-1)
    a052222_list = filter ((== 8) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..1500] | &+Intseq(n) eq 8 ]; // Vincenzo Librandi, Mar 08 2013
    
  • Mathematica
    Select[Range[1500], Total[IntegerDigits[#]] == 8 &] (* Vincenzo Librandi, Mar 08 2013 *)
  • Python
    from sympy.utilities.iterables import multiset_permutations
    def auptodigs(maxdigits):
        alst = []
        for d in range(1, maxdigits+1):
            digset = "0"*(d-1) + "11111111222233445678"
            for p in multiset_permutations(digset, d):
                if p[0] != '0' and sum(map(int, p)) == 8:
                    alst.append(int("".join(p)))
        return alst
    print(auptodigs(4)) # Michael S. Branicky, Aug 17 2021

Extensions

Offset changed from Bruno Berselli, Mar 07 2013

A052220 Numbers whose sum of digits is 6.

Original entry on oeis.org

6, 15, 24, 33, 42, 51, 60, 105, 114, 123, 132, 141, 150, 204, 213, 222, 231, 240, 303, 312, 321, 330, 402, 411, 420, 501, 510, 600, 1005, 1014, 1023, 1032, 1041, 1050, 1104, 1113, 1122, 1131, 1140, 1203, 1212, 1221, 1230, 1302, 1311, 1320, 1401, 1410
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

A007953(a(n)) = 6; number of repdigits = #{6,33,222,111111} = A242627(6) = 4. - Reinhard Zumkeller, Jul 17 2014
There are binomial(t + 4, 5) terms having exactly t digits. Therefore binomial(t + 5, 6) have at most t digits. - David A. Corneth, Jun 29 2025

Examples

			1023 is in the sequence as it has digital sum 1 + 0 + 2 + 3 = 6. - _David A. Corneth_, Jun 29 2025
		

Crossrefs

Cf. A007953.
Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).

Programs

  • Haskell
    a052220 n = a052220_list !! (n-1)
    a052220_list = filter ((== 6) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..1500] | &+Intseq(n) eq 6 ]; // Vincenzo Librandi, Mar 07 2013
    
  • Mathematica
    Select[Range[10^4], Total[IntegerDigits[#]] == 6 &] (* Vincenzo Librandi, Mar 07 2013 *)
  • PARI
    nxt(n) = {my(v, c, toadd); v = valuation(n, 10); c = (n / 10^v)%10; toadd = 10^(v)*(10 - c) + c - 1; return(n + toadd)} \\ David A. Corneth, Jun 29 2025
  • Python
    from sympy.utilities.iterables import multiset_permutations
    def auptodigs(maxdigits):
        alst = []
        for d in range(1, maxdigits+1):
            digset = "0"*(d-1) + "11111122233456"
            for p in multiset_permutations(digset, d):
                if p[0] != '0' and sum(map(int, p)) == 6:
                    alst.append(int("".join(p)))
        return alst
    print(auptodigs(4)) # Michael S. Branicky, Jun 15 2021
    

Formula

a(n) = a(n-1) + 10^v * (10 - c) + c-1 where c is the last nonzero digit of a(n) and v is the 10-adic valuation of a(n-1) and n > 1. - David A. Corneth, Jun 29 2025

Extensions

Offset changed by Bruno Berselli, Mar 07 2013
Showing 1-10 of 30 results. Next