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

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

A135110 Positive numbers such that the digital sum base 2 and the digital sum base 10 are in a ratio of 2:10.

Original entry on oeis.org

32, 69, 136, 168, 276, 389, 514, 546, 596, 640, 672, 785, 848, 1284, 1289, 1298, 1793, 1798, 1856, 1888, 2058, 2080, 2184, 2369, 2562, 2594, 2698, 2896, 3089, 3589, 4164, 4169, 4178, 4196, 4353, 4358, 4376, 4385, 4416, 4448, 4484, 4489, 4498, 4628, 4673
Offset: 1

Views

Author

Hieronymus Fischer, Dec 24 2007

Keywords

Comments

Subsequence of A227793. - Michel Marcus, Sep 23 2013

Examples

			a(1)=32, since ds_2(32):ds_10(32)=1:5=2:10.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5000],5*Total[IntegerDigits[#,2]]==Total[ IntegerDigits[ #]]&] (* Harvey P. Dale, Sep 14 2012 *)
  • PARI
    is(n)=sumdigits(n)/hammingweight(n)==5 \\ Charles R Greathouse IV, Sep 22 2013

A062340 Primes whose sum of digits is a multiple of 5.

Original entry on oeis.org

5, 19, 23, 37, 41, 73, 109, 113, 127, 131, 163, 181, 271, 307, 311, 389, 401, 433, 479, 523, 541, 569, 587, 613, 631, 659, 677, 811, 839, 857, 929, 947, 983, 997, 1009, 1013, 1031, 1063, 1103, 1117, 1153, 1171, 1289, 1301, 1423, 1487, 1531, 1559, 1621, 1667
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

			569 is a prime with sum of digits = 20, hence belongs to the sequence.
		

Crossrefs

Cf. A007953 (sum of digits), A227793 (sum of digits divisible by 5).
Has as subsequence A062341 (primes with sum of digits s = 5), A107579 (s = 10), A106760 (s = 20), A106763 (s = 25), A106770 (s = 35), A106773 (s = 40), A106780 (s = 50), A106783 (s = 55), A107619 (s = 65) and A181321 (s = 70).
Cf. A062340 (equivalent for 8).

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 5 eq 0 ]; // Vincenzo Librandi, Apr 02 2011
    
  • Mathematica
    Select[Prime[Range[300]],Divisible[Total[IntegerDigits[#]],5]&] (* Harvey P. Dale, Jul 06 2020 *)
  • PARI
    select( {is_A062340(n)=sumdigits(n)%5==0&&isprime(n)}, primes([1,2000])) \\ M. F. Hasler, Mar 10 2022
  • Python
    from sympy import primerange as primes
    def ok(p): return sum(map(int, str(p)))%5 == 0
    print(list(filter(ok, primes(1, 1668)))) # Michael S. Branicky, May 19 2021
    

Formula

Intersection of A000040 (primes) and A227793 (sum of digits in 5Z). - M. F. Hasler, Mar 10 2022

Extensions

Corrected and extended by Harvey P. Dale and Larry Reeves (larryr(AT)acm.org), Jul 04 2001

A246880 6*((10^n-1)/9)*(10^(n+1))+9*(10^n-1)/9.

Original entry on oeis.org

0, 609, 66099, 6660999, 666609999, 66666099999, 6666660999999, 666666609999999, 66666666099999999, 6666666660999999999, 666666666609999999999, 66666666666099999999999, 6666666666660999999999999, 666666666666609999999999999, 66666666666666099999999999999
Offset: 0

Views

Author

Felix Fröhlich, Sep 06 2014

Keywords

Comments

Numbers of the form 6...609...9 (i.e., consisting of an odd number of digits with the middle digit 0, all digits to the left of the middle digit 6 and all digits to the right of the middle digit 9).

Crossrefs

Programs

  • Magma
    [(6*((10^n - 1)/9))*(10^(n + 1)) + (9*(10^n - 1)/9) : n in [0..15]]; // Wesley Ivan Hurt, Sep 15 2014
  • Maple
    A246880:=n->(6*((10^n - 1)/9))*(10^(n + 1)) + (9*(10^n - 1)/9): seq(A246880(n),n=0..15); # Wesley Ivan Hurt, Sep 15 2014
  • Mathematica
    Table[(6*((10^n - 1)/9))*(10^(n + 1)) + (9*(10^n - 1)/9), {n, 15}] (* Wesley Ivan Hurt, Sep 15 2014 *)
    Join[{0}, CoefficientList[Series[20/(3 x - 300 x^2) + 1/(x^2 - x) + 17/(30 x^2 - 3 x), {x, 0, 30}], x]] (* Wesley Ivan Hurt, Sep 15 2014 *)
  • PARI
    a(n)=6*((10^n-1)/9)*(10^(n+1))+9*(10^n-1)/9
    

Formula

G.f.: 20/(3-300*x)+1/(x-1)+17/(30*x-3); a(n) = 111*a(n-1)-1110*a(n-2)+1000*a(n-3). - Wesley Ivan Hurt, Sep 15 2014

A268620 Numbers whose digital sum is a multiple of 4.

Original entry on oeis.org

0, 4, 8, 13, 17, 22, 26, 31, 35, 39, 40, 44, 48, 53, 57, 62, 66, 71, 75, 79, 80, 84, 88, 93, 97, 103, 107, 112, 116, 121, 125, 129, 130, 134, 138, 143, 147, 152, 156, 161, 165, 169, 170, 174, 178, 183, 187, 192, 196, 202, 206, 211, 215, 219, 220, 224, 228, 233, 237, 242, 246
Offset: 1

Views

Author

Bruno Berselli, Feb 09 2016

Keywords

Comments

a(1498) = 5999 is the smallest term that is congruent to 5 modulo 9.

Crossrefs

Cf. A007953, A061383 (supersequence).
Cf. numbers whose digital sum is a multiple of k: A054683 (k=2), A008585 (k=3), this sequence (k=4), A227793 (k=5).

Programs

  • Magma
    [n: n in [0..250] | IsIntegral(&+Intseq(n)/4)];
  • Maple
    select(t -> convert(convert(t,base,10),`+`) mod 4 = 0, [$1..1000]); # Robert Israel, Feb 09 2016
  • Mathematica
    Select[Range[0, 250], IntegerQ[Total[IntegerDigits[#]]/4] &]

A273188 Numbers whose digit sum is divisible by 8.

Original entry on oeis.org

0, 8, 17, 26, 35, 44, 53, 62, 71, 79, 80, 88, 97, 107, 116, 125, 134, 143, 152, 161, 169, 170, 178, 187, 196, 206, 215, 224, 233, 242, 251, 259, 260, 268, 277, 286, 295, 305, 314, 323, 332, 341, 349, 350, 358, 367, 376, 385, 394, 404, 413, 422, 431, 439, 440, 448, 457, 466
Offset: 1

Views

Author

Elana Lessing, May 17 2016

Keywords

Comments

Is a(n) ~ 8n? - David A. Corneth, May 19 2016

Crossrefs

Cf. A062342 (subsequence of primes), A227793 (equivalent for 5).

Programs

  • Mathematica
    Select[Range@ 600, Mod[Total@ IntegerDigits@ #, 8] == 0 &] (* Michael De Vlieger, May 19 2016 *)
  • PARI
    isok(n) = sumdigits(n) % 8 == 0; \\ Michel Marcus, May 18 2016
Showing 1-6 of 6 results.