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

A309539 Positive numbers that contain both odd and even digits, with no digit repeated.

Original entry on oeis.org

10, 12, 14, 16, 18, 21, 23, 25, 27, 29, 30, 32, 34, 36, 38, 41, 43, 45, 47, 49, 50, 52, 54, 56, 58, 61, 63, 65, 67, 69, 70, 72, 74, 76, 78, 81, 83, 85, 87, 89, 90, 92, 94, 96, 98, 102, 103, 104, 105, 106, 107, 108, 109, 120, 123, 124, 125, 126, 127, 128, 129, 130, 132, 134, 136
Offset: 1

Views

Author

Enrique Navarrete, Aug 06 2019

Keywords

Comments

Unlike A318700, where digits can be repeated, this sequence is finite; last term is 9876543210.

Examples

			49 and 50 are in the sequence but 19 and 20 are not.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
      L:= convert(n,base,10);
      nops(L) = nops(convert(L,set)) and convert(L mod 2,set) = {0,1};
    end proc:
    select(filter, [$10 .. 1000]); # Robert Israel, Jan 09 2025
  • Mathematica
    boeQ[n_]:=Max[DigitCount[n]]==1&&IntegerLength[n]>Count[ IntegerDigits[ n],?EvenQ]>0; Select[Range[150],boeQ] (* _Harvey P. Dale, Jul 02 2020 *)
  • PARI
    isok(n) = my(d=digits(n)); (#d == #Set(d)) && #select(x->(x%2), d) && #select(x->!(x%2), d); \\ Michel Marcus, Aug 07 2019

A309390 Set a(1)=10. Thereafter a(n) is the smallest positive number not yet in the sequence that contains exactly one even digit and one odd digit from a(n-1).

Original entry on oeis.org

10, 100, 101, 102, 12, 21, 112, 120, 103, 30, 130, 104, 14, 41, 114, 124, 121, 122, 123, 23, 32, 132, 125, 25, 52, 152, 126, 16, 61, 106, 105, 50, 150, 107, 70, 170, 108, 18, 81, 118, 128, 127, 27, 72, 172, 129, 29, 92, 192, 142, 134, 34, 43, 143, 140, 109, 90, 190, 110, 160, 116
Offset: 1

Views

Author

Enrique Navarrete, Jul 27 2019

Keywords

Comments

Numbers such as 3, 8, 20, 31, and 42 are not in the sequence since by definition all terms must contain both odd and even digits.

Examples

			a(2)=100 since it is the smallest number not yet in the sequence that contains an even digit (0) and an odd digit (1) from a(1)=10.
a(7)=112 since it is the smallest number not yet in the sequence that contains an even digit (2) and an odd digit (1) from a(6)=21.
a(27)=126 is not 105 since 105 would contain two odd digits (1 and 5) from a(26)=152.
		

Crossrefs

Cf. A318700 (positive numbers that contain both odd and even digits).

A309540 a(n) is the smallest positive number not yet in the sequence that contains exactly one even digit and exactly one odd digit from a(n-1), and no digit in a(n) is repeated.

Original entry on oeis.org

10, 102, 12, 21, 120, 103, 30, 130, 104, 14, 41, 124, 123, 23, 32, 132, 125, 25, 52, 152, 126, 16, 61, 106, 105, 50, 150, 107, 70, 170, 108, 18, 81, 128, 127, 27, 72, 172, 129, 29, 92, 192, 142, 134, 34, 43, 143, 140, 109, 90, 190, 160, 136, 36, 63, 163
Offset: 1

Views

Author

Enrique Navarrete, Aug 06 2019

Keywords

Examples

			a(2)=102: a(2) is not 100 (since zero would be repeated), nor 101 (since 1 would be repeated).
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
      L:= convert(n,base,10);
      nops(L) = nops(convert(L,set)) and convert(L mod 2,set) = {0,1};
    end proc:
    Cands:= select(filter, [$11 .. 1000]): nC:= nops(Cands):
    R:= 10: r:= 10: r0, r1:= selectremove(type, convert(convert(r,base,10),set),even):
    for count from 1 do
      found:= false;
      for i from 1 to nC+1-count do
        x:= Cands[i];
        Lx:= convert(convert(x,base,10),set);
        if nops(Lx intersect r0) = 1 and nops(Lx intersect r1) = 1 then
          found:= true;
          R:= R, x;
          r:= x;
          Cands:= subsop(i=NULL, Cands);
          r0, r1:= selectremove(type, convert(convert(r,base,10),set),even);
          break
        fi
      od;
      if not found then break fi;
    od:
    R; # Robert Israel, Jan 09 2025

Extensions

Edited by Robert Israel, Jan 10 2025
Showing 1-3 of 3 results.