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

A340470 Two adjacent integers sum up to a term of A036301.

Original entry on oeis.org

0, 112, 9, 103, 18, 94, 27, 85, 36, 76, 45, 67, 54, 58, 63, 49, 72, 40, 81, 31, 90, 22, 99, 13, 108, 4, 117, 17, 95, 26, 86, 35, 77, 44, 68, 53, 59, 62, 50, 71, 41, 80, 32, 89, 23, 98, 14, 107, 5, 116, 198, 138, 73, 39, 82, 30, 91, 21, 100, 12, 109, 3, 118, 16, 96, 25
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Jan 08 2021

Keywords

Comments

This is the lexicographically earliest sequence of distinct nonnegative terms with this property.

Examples

			a(1) + a(2) = 0 + 112 = 112 (a term of A036301);
a(2) + a(3) = 112 + 9 = 121 (a term of A036301);
a(3) + a(4) = 9 + 103 = 112;
a(4) + a(5) = 103 + 18 = 121; etc.
		

Crossrefs

Cf. A036301 (even digits sum = odd digits sum).

Programs

  • Magma
    f:=func; a:=[0]; for n in [2..80] do k:=1; while k in a or not f(k+a[n-1]) do k:=k+1; end while; Append(~a,k); end for; a; // Marius A. Burtea, Jan 12 2021

A364863 Number of iterations of x -> x + min { k in A036301 | k > x } until an element of A036301 is reached, or -1 if this never happens, starting with n.

Original entry on oeis.org

0, 21
Offset: 0

Views

Author

M. F. Hasler, Aug 11 2023

Keywords

Comments

The question whether the iteration always reaches an element of A036301 was raised on the SeqFan list in 2018, with "closest" instead of "next larger" (element of A036301). In that case one has 0 < n < 56 as a trivial counterexample. It is still open to our knowledge.
The first unknown term is currently a(2). Starting with x =2 we reach x = 336917039990529107004169 after 72 iterations.

Examples

			a(0) = 0 because n = 0 is an element of A036301 and therefore no iteration is required to reach such an element.
The smallest nonzero element of A036301 is 112. Therefore, all smaller positive numbers 0 < n < 112 go to n + 112 under the first iteration of
  f: x -> x + min { k in A036301 | k > x }.
Under iterations of f, 1 -> 113 -> 234 -> 548 -> 1109 -> 2229 -> 4460 -> 8931 -> 17865 -> 35872 -> 71875 -> 143891 -> 287898 -> 575804 -> 1151810 -> 2303826 -> 4607657 -> 9215347 -> 18430735 -> 36861480 -> 73723189 -> 147446477 which is the first element of A036301 to be reached, after a(1) = 21 iterations.
		

Crossrefs

Programs

  • PARI
    a(n) = for(k=0,oo, A071650(n) || return(k); n+=next_A036301(n))

Formula

a(n) = 0 iff A071650(n) = 0, i.e., for all n in A036301.

A340574 a(1) = 112. a(n) is the smallest number k with the sum of the even digits equal to the sum of the odd digits (A036301), which is not an earlier term, for which k*a(n - 1) has the sum of the even digits equal to the sum of the odd digits (A036301).

Original entry on oeis.org

112, 583, 1120, 781, 1452, 615, 1627, 1694, 1506, 1403, 1078, 1043, 538, 121, 4983, 1087, 1708, 1304, 314, 385, 341, 134, 187, 1340, 718, 2123, 358, 1021, 1102, 211, 835, 2110, 1322, 3265, 2558, 561, 1034, 871, 2167, 3085, 1232, 1245, 413, 2716, 1201, 1012, 336
Offset: 1

Views

Author

Marius A. Burtea, Jan 12 2021

Keywords

Comments

Sequence only with terms in A036301 for which a(n)*a(n+1) is a term in A036301.
a(1) = 112 = A036301(2) is the first nonzero term of A036301.
The sequence is infinite.

Examples

			a(1) = 112, a(2) = 583 = A036301(22) and a(1)*a(2) = 112*583 = 65296 is a term in A036301 because 6 + 2 + 6 = 14 = 5 + 9.
a(2) = 583, a(3) = 1120 = A036301(41) and a(2)*a(3) = 583*1120 = 652960 is a term in A036301 because 6 + 2 + 6 + 0 = 14 = 5 + 9.
		

Crossrefs

Programs

  • Magma
    f:=func; a:=[112]; for n in [2..50] do k:=1; while k in a or not f(k) or not f(k*a[n-1]) do k:=k+1; end while; Append(~a,k); end for; a;
    
  • PARI
    isokd(n) = my(d=digits(n)); sum(k=1, #d, d[k]*(d[k] % 2)) == sum(k=1, #d, d[k]*(1-d[k]%2)); \\ A036301
    nextk(va, n) = {my(ok = 0, k = 1); while (! (isokd(k) && isokd(k*va[n-1]) && !#select(x->(x==k), va)), k++); k;}
    lista(nn) = {my(va = vector(nn)); va[1] = 112; for (n=2, nn, my(k = nextk(va, n)); va[n] = k;); va;} \\ Michel Marcus, Jan 14 2021

A124176 Consider the map f that sends m to m + (sum of odd digits of m) - (sum of even digits of m). Sequence gives numbers m such that f^(k)(m) = m for some k.

Original entry on oeis.org

0, 11, 13, 17, 18, 25, 28, 54, 55, 64, 65, 112, 121, 134, 137, 143, 148, 155, 156, 165, 166, 173, 178, 184, 187, 198, 200, 209, 211, 216, 231, 233, 234, 237, 244, 245, 270, 275, 280, 285, 314, 336, 341, 358, 363, 385, 396, 402, 407, 410, 413, 429, 431, 432
Offset: 1

Views

Author

Eric Angelini, Dec 04 2006

Keywords

Comments

Terms computed by Barry and Theunis de Jong.
Subsequence A036301 lists fixed points of the map f = A304439. - M. F. Hasler, May 18 2018

Examples

			11 and 13 loop on themselves, but 12 doesn't:
11 -> 13 -> 17 -> 25 -> 28 -> 18 -> 11
12 -> 11 -> 13 -> 17 -> 25 -> 28 -> 18 -> 11
13 -> 17 -> 25 -> 28 -> 18 -> 11 -> 13.
		

Crossrefs

Programs

  • PARI
    is(n,S=List())=until(setsearch(Set(S),n=A304439(n)),listput(S,n));n==S[1] \\ M. F. Hasler, May 18 2018

A124177 Consider the map f that sends m to m + (sum of even digits of m) - (sum of odd digits of m). Sequence gives numbers m such that f^(k)(m) = m for some k.

Original entry on oeis.org

0, 22, 26, 27, 34, 35, 44, 49, 52, 63, 66, 78, 79, 81, 88, 99, 104, 107, 108, 112, 115, 121, 126, 133, 134, 143, 144, 151, 156, 165, 178, 187, 211, 224, 229, 232, 233, 283, 290, 314, 336, 341, 358, 363, 385, 413, 431, 467, 470, 489, 492, 516, 538, 561, 583, 615
Offset: 1

Views

Author

Eric Angelini, Dec 04 2006

Keywords

Comments

Terms computed by Theunis de Jong.
Subsequence A036301 lists fixed points of the map f = A304440. - M. F. Hasler, May 18 2018

Examples

			26 and 27 loop on themselves, but 28 doesn't.
26 -> 34 -> 35 -> 27 -> 22 -> 26
27 -> 22 -> 26 -> 34 -> 35 -> 27
28 -> 38 -> 43 -> 44 -> 52 -> 49 -> 44.
		

Crossrefs

Programs

  • PARI
    is(n,S=List())={until(setsearch(Set(S),n=A304440(n)),listput(S,n));n==S[1]} \\ M. F. Hasler, May 18 2018

A341002 Numbers whose sum of even digits and sum of odd digits differ by 1.

Original entry on oeis.org

1, 10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98, 100, 102, 120, 201, 203, 210, 223, 225, 230, 232, 245, 247, 252, 254, 267, 269, 274, 276, 289, 296, 298, 302, 304, 320, 322, 340, 403, 405, 425, 427, 430, 447, 449, 450, 452, 469, 472, 474, 494, 496, 504
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]] == 1 &] (* Amiram Eldar, Feb 02 2021 *)

A071650 Difference between sums of odd and even digits of n.

Original entry on oeis.org

1, -2, 3, -4, 5, -6, 7, -8, 9, 1, 2, -1, 4, -3, 6, -5, 8, -7, 10, -2, -1, -4, 1, -6, 3, -8, 5, -10, 7, 3, 4, 1, 6, -1, 8, -3, 10, -5, 12, -4, -3, -6, -1, -8, 1, -10, 3, -12, 5, 5, 6, 3, 8, 1, 10, -1, 12, -3, 14, -6, -5, -8, -3, -10, -1, -12, 1, -14, 3, 7, 8, 5, 10
Offset: 1

Views

Author

Reinhard Zumkeller, May 28 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Total[Select[IntegerDigits[n],OddQ]]-Total[Select[ IntegerDigits[ n],EvenQ]],{n,80}] (* Harvey P. Dale, Jul 27 2020 *)
  • PARI
    a(n) = {my(d=digits(n), s = 0); for (k=1, #d, if (d[k] % 2, s += d[k], s -= d[k]);); s;} \\ Michel Marcus, Aug 05 2017
    
  • PARI
    A071650(n)=-vecsum(apply(t->(-1)^t*t,digits(n))) \\ M. F. Hasler, Dec 09 2018

Formula

a(n) = A071649(n) - A071648(n);
a(A036301(n)) = 0.

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 *)

A304439 Add to n the sum of its odd digits minus the sum of its even digits.

Original entry on oeis.org

0, 2, 0, 6, 0, 10, 0, 14, 0, 18, 11, 13, 11, 17, 11, 21, 11, 25, 11, 29, 18, 20, 18, 24, 18, 28, 18, 32, 18, 36, 33, 35, 33, 39, 33, 43, 33, 47, 33, 51, 36, 38, 36, 42, 36, 46, 36, 50, 36, 54, 55, 57, 55, 61, 55, 65, 55, 69, 55, 73, 54, 56, 54, 60, 54, 64, 54, 68, 54, 72
Offset: 0

Views

Author

M. F. Hasler, May 18 2018

Keywords

Comments

Subsequence A036301 lists fixed points of this map, the first nontrivial one being 112. It is a subsequence of A124176 (and A124177) which considers iterations of this map, more precisely, numbers which are in a cyclic orbit for iterations of this map.

Crossrefs

Programs

  • Mathematica
    soded[n_]:=Module[{idn=IntegerDigits[n]},n+Total[Select[idn,OddQ]]-Total[ Select[idn,EvenQ]]]; Array[soded,70,0] (* Harvey P. Dale, Aug 12 2021 *)
  • PARI
    A304439(n)=n-vecsum(apply(t->t*(-1)^t,digits(n)))

Formula

a(n) = n + A071650(n).

A304440 Add to n the sum of its even digits minus the sum of its odd digits.

Original entry on oeis.org

0, 0, 4, 0, 8, 0, 12, 0, 16, 0, 9, 9, 13, 9, 17, 9, 21, 9, 25, 9, 22, 22, 26, 22, 30, 22, 34, 22, 38, 22, 27, 27, 31, 27, 35, 27, 39, 27, 43, 27, 44, 44, 48, 44, 52, 44, 56, 44, 60, 44, 45, 45, 49, 45, 53, 45, 57, 45, 61, 45, 66, 66, 70, 66, 74, 66, 78, 66, 82, 66, 63
Offset: 0

Views

Author

M. F. Hasler, May 18 2018

Keywords

Comments

A036301 lists fixed points of this map, the first nonzero one being 112. It is also a subsequence of A124177 (and A124176) which lists numbers which are in a cyclic orbit under iterations of this map.

Crossrefs

Cf. A304439 (variant: + even - odd digits), A071650 (odd - even digits), A071648, A071649, A036301 (fixed points), A124177, A124176.

Programs

  • Mathematica
    nseo[n_]:=Module[{idn=IntegerDigits[n]},n+Total[Select[idn,EvenQ]]-Total[Select[idn,OddQ]]]; Array[nseo,80,0] (* Harvey P. Dale, Dec 26 2023 *)
  • PARI
    A304440(n)=n+vecsum(apply(t->t*(-1)^t,digits(n)))

Formula

a(n) = n - A071650(n).
Showing 1-10 of 33 results. Next