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 13 results. Next

A341010 Numbers whose sum of even digits and sum of odd digits differ by 9.

Original entry on oeis.org

9, 90, 117, 128, 135, 146, 153, 164, 171, 182, 218, 281, 315, 333, 348, 351, 366, 384, 416, 438, 461, 483, 513, 531, 568, 586, 614, 636, 641, 658, 663, 685, 711, 788, 812, 821, 834, 843, 856, 865, 878, 887, 900, 1017, 1028, 1035, 1046, 1053, 1064, 1071, 1082, 1107, 1129, 1170
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1200], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 9 &] (* Amiram Eldar, Feb 02 2021 *)

A341003 Numbers whose sum of even digits and sum of odd digits differ by 2.

Original entry on oeis.org

2, 11, 20, 101, 110, 114, 123, 132, 136, 141, 145, 154, 158, 163, 167, 176, 185, 189, 198, 200, 213, 231, 312, 316, 321, 334, 338, 343, 356, 361, 365, 378, 383, 387, 411, 415, 433, 451, 514, 518, 536, 541, 558, 563, 581, 585, 613, 617, 631, 635, 653, 671, 716, 738, 761, 783
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 2 &] (* Amiram Eldar, Feb 02 2021 *)

A341004 Numbers whose sum of even digits and sum of odd digits differ by 3.

Original entry on oeis.org

3, 14, 25, 30, 36, 41, 47, 52, 58, 63, 69, 74, 85, 96, 104, 111, 122, 140, 205, 212, 221, 227, 234, 243, 249, 250, 256, 265, 272, 278, 287, 294, 300, 306, 324, 342, 360, 401, 407, 410, 423, 429, 432, 445, 454, 467, 470, 476, 489, 492, 498, 502, 508, 520, 526, 544, 562, 580
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 3 &] (* Amiram Eldar, Feb 02 2021 *)

A341005 Numbers whose sum of even digits and sum of odd digits differ by 4.

Original entry on oeis.org

4, 13, 22, 31, 40, 103, 116, 125, 130, 138, 147, 152, 161, 169, 174, 183, 196, 202, 215, 220, 233, 251, 301, 310, 318, 323, 332, 345, 354, 367, 376, 381, 389, 398, 400, 417, 435, 453, 471, 512, 521, 534, 543, 556, 565, 578, 587, 611, 619, 637, 655, 673, 691, 714, 736, 741, 758
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).
Cf. A071650 (difference between sum of even and sum of odd digits).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 4 &] (* Amiram Eldar, Feb 02 2021 *)
  • Python
    def ok(n):
      sums = [0, 0]
      for d in str(n): sums[d in "13579"] += int(d)
      return abs(sums[0] - sums[1]) == 4
    print(list(filter(ok, range(759)))) # Michael S. Branicky, Apr 13 2021

A341006 Numbers whose sum of even digits and sum of odd digits differ by 5.

Original entry on oeis.org

5, 16, 27, 38, 49, 50, 61, 72, 83, 94, 106, 113, 124, 131, 142, 160, 207, 214, 229, 236, 241, 258, 263, 270, 285, 292, 308, 311, 326, 344, 362, 380, 409, 412, 421, 434, 443, 456, 465, 478, 487, 490, 500, 528, 546, 564, 582, 601, 610, 623, 632, 645, 654, 667, 676, 689, 698, 702
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 5 &] (* Amiram Eldar, Feb 02 2021 *)

A341007 Numbers whose sum of even digits and sum of odd digits differ by 6.

Original entry on oeis.org

6, 15, 24, 33, 42, 51, 60, 105, 118, 127, 149, 150, 172, 181, 194, 204, 217, 222, 235, 240, 253, 271, 303, 325, 330, 347, 352, 369, 374, 396, 402, 419, 420, 437, 455, 473, 491, 501, 510, 523, 532, 545, 554, 567, 576, 589, 598, 600, 639, 657, 675, 693, 712, 721, 734, 743, 756
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 6 &] (* Amiram Eldar, Feb 02 2021 *)

A341008 Numbers whose sum of even digits and sum of odd digits differ by 7.

Original entry on oeis.org

7, 18, 29, 70, 81, 92, 108, 115, 126, 133, 144, 151, 162, 180, 209, 216, 238, 261, 283, 290, 313, 328, 331, 346, 364, 382, 414, 436, 441, 458, 463, 485, 511, 548, 566, 584, 612, 621, 634, 643, 656, 665, 678, 687, 700, 768, 786, 801, 810, 823, 832, 845, 854, 867, 876, 889, 898
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 7 &] (* Amiram Eldar, Feb 02 2021 *)
  • Python
    def ok(n):
      s = str(n)
      return abs(sum(map(int, s))-2*sum(int(d) for d in s if d in "2468")) == 7
    print(list(filter(ok, range(900)))) # Michael S. Branicky, Jul 18 2021

A341009 Numbers whose sum of even digits and sum of odd digits differ by 8.

Original entry on oeis.org

8, 17, 26, 35, 44, 53, 62, 71, 80, 107, 129, 170, 192, 206, 219, 224, 237, 242, 255, 260, 273, 291, 305, 327, 349, 350, 372, 394, 404, 422, 439, 440, 457, 475, 493, 503, 525, 530, 547, 552, 569, 574, 596, 602, 620, 659, 677, 695, 701, 710, 723, 732, 745, 754, 767, 776, 789
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A009994, A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 8 &] (* Amiram Eldar, Feb 02 2021 *)
  • Python
    def eodiff(n):
      digs = list(map(int, str(n)))
      return abs(sum(d for d in digs if d%2==0)-sum(d for d in digs if d%2==1))
    def aupto(lim): return [m for m in range(lim+1) if eodiff(m) == 8]
    print(aupto(789)) # Michael S. Branicky, Feb 21 2021

A341011 a(n) is the smallest positive number m not yet in the sequence with the property that the sum of the even digits of m and the sum of the odd digits of m differ by n.

Original entry on oeis.org

112, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 119, 39, 139, 59, 159, 79, 179, 99, 199, 488, 399, 688, 599, 888, 799, 1799, 999, 1999, 11999, 3999, 13999, 5999, 15999, 7999, 17999, 9999, 19999, 68888, 39999, 88888, 59999, 159999, 79999, 179999, 99999, 199999, 1199999, 399999, 1399999, 599999, 1599999, 799999, 1799999, 999999
Offset: 0

Views

Author

Carole Dubois and Eric Angelini, Feb 02 2021

Keywords

Comments

This is the lexicographically earliest sequence of distinct integers > 0 having this property.
Indices of terms not congruent to 9 (mod 10): 0, 1, 2, 3, 4, 5, 6, 7, 8, 20, 22, 24, 38, 40, 56, .... - Robert G. Wilson v, Feb 21 2021

Examples

			a(19) = 199 since 199 is the smallest number such that the sum of even digits (0) and the sum of odd digits (19) differ by n = 19;
a(20) = 488 since 488 is the smallest number such that the sum of even digits (20) and the sum of odd digits (0) differ by n = 20; etc.
		

Crossrefs

Programs

  • Mathematica
    del[n_] := Abs[Plus @@ Select[(d = IntegerDigits[n]), OddQ] - Plus @@ Select[d, EvenQ]]; m = 54; s = Table[0, {m}]; c = n = 0; While[c < m, n++; i = del[n]; If[i > 0 && i <= m && s[[i]] == 0, c++; s[[i]] = n]]; s (* Amiram Eldar, Feb 02 2021 *)
    f[n_] := Block[{b, c, d, e, o}, d = 0; c = Floor[n/9]; b = 10^c -1; While[n != (Plus @@ IntegerDigits[d*10^c + b]), If[ OddQ@ d, d += 2, d++]]; o = d*10^c + b;
    d = 0; c = Floor[n/8]; b = 8(10^c -1)/9; While[n != (Plus @@ IntegerDigits[d*10^c + b]), If[ OddQ@ d, d++, d += 2]]; e = d*10^c + b; Min[o, e]]; f[0] = 112; (* Robert G. Wilson v, Feb 21 2021 *)

Extensions

a(0) added by Robert G. Wilson v, Feb 21 2021

A341012 The cumulative sum of the even digits so far in the sequence and the cumulative sum of the odd digits so far differ by n for all a(n)s.

Original entry on oeis.org

1, 10, 16, 7, 23, 32, 45, 54, 67, 76, 89, 98, 100, 203, 225, 230, 247, 252, 269, 274, 296, 302, 320, 405, 427, 449, 450, 472, 494, 504, 522, 540, 607, 629, 670, 692, 706, 724, 742, 760, 809, 890, 908, 926, 944, 962, 980, 1000, 1112, 1121, 1134, 1143, 1156, 1165, 1178
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Comments

This is the lexicographically earliest sequence of distinct integers > 0 having this property.

Examples

			Say that the current sequence is S, the cumulative sum at any moment of the even digits of S is E, the cumulative sum at any moment of the odd digits of S is O and the absolute difference |E-O| is D. We would then have:
S = 1, 10, 16, 7, 23, 32, 45, 54, 67, 76, 89, 98,...
E = 0   0   6  6   8  10  14  18  24  30  38  46
O = 1   2   3 10  13  16  21  26  33  40  49  58
D = 1   2   3  4   5   6   7   8   9  10  11  12 <-- this is = n.
		

Crossrefs

Cf. A341002 (numbers whose sum of even digits and sum of odd digits differ by 1).
Showing 1-10 of 13 results. Next