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.

A120125 Smallest positive integer not already in the sequence such that digits used are balanced: no digit appears more than 1 times more than any other.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 45, 67, 89, 12, 30, 46, 57, 98, 13, 20, 47, 56, 189, 24, 35, 60, 78, 19, 25, 34, 68, 70, 29, 14, 36, 50, 79, 18, 26, 37, 40, 58, 39, 15, 27, 48, 69, 80, 16, 32, 49, 75, 90, 17, 28, 43, 65, 100, 38, 42, 59, 76, 21, 53, 64, 87, 109, 52, 63, 74
Offset: 0

Views

Author

Keywords

Comments

Numbers where some digit occurs two times more than some other digit (such as 11) will eventually occur in this sequence; but those such as 111 where a digit occurs three times more than some other will not.

Examples

			After 56, digits 8 and 9 have been used one less time than the others. 8, 9, 89 and 98 are already used, so we need a three digit number including 8 and 9. 189 is the smallest such.
		

Crossrefs

Cf. A095204 (strictly increasing version).

A095205 Least nonnegative integer not already in the sequence such that the frequency of digits in the entire sequence is as close to a uniform distribution as possible. A difference in frequency of at most 1 across all digits is allowed, and that difference must always be in favor of digits closer to 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 45, 67, 89, 102, 34, 56, 78, 90, 12, 43, 65, 87, 109, 32, 54, 76, 98, 120, 345, 678, 190, 234, 567, 809, 21, 354, 687, 901, 243, 576, 890, 123, 456, 789, 201, 435, 768, 910, 324, 657, 908, 132, 465, 798, 210, 453, 786, 1029
Offset: 0

Views

Author

Amarnath Murthy, Jun 06 2004

Keywords

Comments

Obviously no term contains identical digits and eventually for some m, a(m) = 1023456789 = a(n) for all n > m. Let d = number of numbers containing all distinct digits, using digits 0 to 9, then is it conjectured that: m is not equal to d, i.e., m < d. Question: what is m?

Examples

			After 89 the next term is 102. It is not 11 or 12 as 0 has to occur first, it is not 20 as 1 has to occur earlier to 2.
		

Crossrefs

Cf. A095204.

Extensions

Better definition and more terms from Micah Manary, Nov 13 2019

A248651 a(n) is the smallest number greater than a(n-1) such that in a(1) through a(n) no digit occurs more than once more than any other digit, starting with a(1) = 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 34, 56, 78, 79, 80, 91, 234, 256, 301, 456, 789, 790, 812, 3456, 3457, 6012, 6089, 7123, 8459, 8460, 9123, 9157, 20345, 20678, 31456, 31789, 40256, 40789, 51236, 51789, 60234, 60789, 71234, 71589, 80234, 80569, 91234, 91567, 203456, 203478, 516789, 516790, 518234, 602347, 602389, 714589, 714590, 716238, 802345, 802369, 914567, 914568, 917023, 2034567
Offset: 1

Views

Author

Jeb Adams, Oct 10 2014

Keywords

Comments

Starting with 1, instead of 0 as in A095204, means 0 doesn't appear until a(10)=10, hence a(11)=20, not 23.

Crossrefs

Same definition of A095204, but starting with 1. Similar to A120125.

Programs

  • R
    # Script (R, using base only) to build values in the sequence defined
    # in A248651:
    # a(n) is the smallest number greater than a(n-1) such that no
    # digit appears in the listing of all terms more than one time
    # more than any other digit in the listing, with a(1) = 1.
    digits <- c(0:9) #vector of the digits
    digitCounts <- rep(0L,10) #vector for digit count tracking
    A <- c() #vector of entries
    A[1] <- 1L #first entry
    failed <- 1L #failed entry
    digitCounts[2] = 1L #impact of first entry on digitCounts
    # Build a function that turns a number into a vector of its
    # component digits
    digits <- function(x) {
      if(length(x) > 1 ) {
        lapply(x, digits)
      } else {
        n <- floor(log10(x))+1L
        rev( x %/% 10^seq(0, length.out=n) %% 10 )
      }
    }
    # Engine for testing digits, runs VERY SLOW, but checks every integer.
    # I welcome improvements, note that it respects incrementing
    # more than one digit at a time if that makes sense.
    while (length(A) < 300) {
      i <- max(failed, max(A)) + 1
      newCounts <- digitCounts
      digitList <- digits(i)
      for (j in digitList) {
        newCounts[j + 1] <- newCounts[j + 1] + 1
      }
      if (max(newCounts) - min(newCounts) > 1) {
           failed <- i } else {
            digitCounts <- newCounts
            A <- c(A,as.integer(i))
          }
    } # Jeb Adams, Jul 17 2020

Extensions

Terms a(15) and beyond corrected by Jeb Adams, May 01 2020
Showing 1-3 of 3 results.