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.

A120126 Index of first occurrence of n in A120125, or 0 if not present.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 5654, 15, 20, 35, 45, 50, 55, 39, 29, 21, 64, 5064, 11, 25, 30, 40, 46, 56, 34, 16, 73, 51, 890, 31, 26, 36, 41, 60, 44, 42, 82, 61, 57, 285, 12, 17, 22, 47, 52, 37, 106, 69, 65, 74, 258, 23, 18, 43, 62, 27, 113, 75, 70, 66, 58, 157, 13, 32, 48
Offset: 0

Views

Author

Keywords

Comments

a(0) = 0 is an index, not the default. 111 is the smallest number that does not occur in A120125.

Crossrefs

Cf. A120125.

A095204 a(n) is the smallest number greater than a(n-1) such that in a(0) through a(n) no digit occurs more than once more than any other digit.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 45, 67, 89, 90, 123, 456, 478, 501, 623, 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
Offset: 0

Views

Author

Amarnath Murthy, Jun 06 2004

Keywords

Comments

Question: Formula for a(n)?
Note that, almost always, if the number of digits in a(0) through a(n) is a multiple of 10, a(n+1) = a(n) + 1. (The only exceptions would be if a(n) + 1 had some digit two more times than some other digit.) - Franklin T. Adams-Watters, Jan 11 2006

Examples

			After 10 the next term is 23 and not 11. Any number containing 0 or 1 would occur only after all the digits from 2 to 9 have occurred once.
		

Crossrefs

Cf. A120125 (non-monotonic version).

Programs

  • Maple
    counts:= Array(0..9):
    cp:= Array(0..9):
    counts[0]:= 1:
    A[0]:= 0:
    for n from 1 to 70 do
      for x from A[n-1]+1 do
         L:= convert(x,base,10);
         ArrayTools:-Copy(counts,cp);
         for t in L do cp[t]:= cp[t]+1 od:
         if max(cp) - min(cp) <= 1 then
            A[n]:= x;
            ArrayTools:-Copy(cp,counts);
            break
         fi
      od
    od:
    seq(A[i],i=0..70); # Robert Israel, Sep 03 2015

Extensions

Edited, corrected and extended by Franklin T. Adams-Watters, Jan 11 2006

A333832 Lexicographically earliest array of distinct positive integers read row by row; a single row consists of integers using together exactly 10 distinct digits.

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, 58, 69, 14, 25, 36, 78, 90, 15, 24, 37, 80, 96, 16, 27, 34, 5089, 17, 26, 35, 4089, 18, 29, 40, 53, 76, 19, 28, 43, 56, 70, 21, 38, 49, 60, 75, 31, 42, 50, 68, 79, 32, 41, 59, 6078, 39, 48, 51, 2067, 52, 61, 73, 4098, 54, 62, 71, 3089
Offset: 1

Views

Author

Eric Angelini and Luca Petrone, Apr 07 2020

Keywords

Comments

The array is finite, by definition: its final row consists of the single integer 9876543210. This sequence starts like A120125 but diverges after a(23) = 47, though the same idea is developped.

Examples

			The first eight rows of the array (and the last one) are:
0 1 2 3 4 5 6 7 8 9
10 23 45 67 89
12 30 46 57 98
13 20 47 58 69
14 25 36 78 90
15 24 37 80 96
16 27 34 5089
17 26 35 4089
...
9876543210
		

Crossrefs

Cf. 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).
Cf. A050278.

A345227 Lexicographically earliest infinite sequence of distinct positive numbers such that every block of ten consecutive digits starting from a(1) contains the digits 0 to 9.

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, 890, 14, 25, 36, 78, 90, 15, 24, 37, 68, 91, 26, 34, 50, 79, 80, 16, 27, 35, 48, 92, 17, 38, 40, 59, 60, 18, 29, 43, 65, 70, 19, 28, 53, 64, 71, 32, 49, 58, 607, 21, 39, 54, 76, 800, 31, 42, 69, 75, 81, 52, 63
Offset: 1

Views

Author

Scott R. Shannon, Jun 11 2021

Keywords

Comments

This sequence is similar to A120125, with which it shares the first twenty-four terms, but has a more restrictive condition that every block of ten consecutive digits, beginning with a(1), must contains the digits 0 to 9. The sequence is also forced to be infinite, which means a number cannot be chosen for a(n) that would make it impossible for a(n+1) to exist. See the example below for a(64).
Numerous numbers cannot appear in the sequence as they would violate the requirement of ten consecutive unique digits. Any number with three or more equal consecutive digits cannot occur, nor can numbers with consecutive pairs of the same digit, e.g., 1122. However numbers with a single pair of equal consecutive digits can occur as the first digit may end a block of ten digits while the second digit may start the next. This is not a common occurrence so such numbers may not appear for many terms, e.g., a(4231) = 11.
When n becomes greater than 10^10 all numbers would be forced to consist of runs of the ten digits 0 to 9 in all possible orderings, leading to even greater restrictions on the possible terms. The behavior of the sequence in this regime is not known.

Examples

			a(11) = 10. The first ten terms contain the digits 0 to 9 so a(11) begins the second block of ten digits so is free to choose any distinct digits that can form the lowest number not yet seen. The lowest such number is 10.
a(12) = 23 as a(11) used the digits 0 and 1, so the next lowest distinct number that can be created from the available digits 2 to 9 is 23.
a(16) = 12 as a(15) ended the second block of ten digits so a(16) is free to choose any distinct digits that can form the lowest number not yet seen. The lowest such number is 12.
a(25) = 890. This term ends the fourth block of ten unique digits and the only available digits to use are 8 and 9. But both 89 and 98 have previously appeared so the next lowest number possible is 890. This term uses the 0 digit in the fifth block of ten digits. This is the first term that differs from A120125.
a(64) = 607. This is the first time where a term is determined by the requirement that the next term must exist. As a(64) is written the three available digits are 0, 6 and 7. The number 67 has been used but 76 is available. But setting a(64) to 76 would force the next term to start with 0. As we do not allow 0 as a leading digit this would mean a(65) would not exist. Thus 76 cannot be chosen, and the next lowest number that can be created from 0, 6 and 7 that avoids leaving 0 as the only available digit is 607.
		

Crossrefs

Programs

  • PARI
    See Links section.

A351993 Lexicographically earliest infinite sequence of distinct positive numbers such that, when they are written in binary and concatenated, every pair of digits starting from a(1) contains the digits 0 and 1.

Original entry on oeis.org

0, 1, 2, 4, 5, 9, 10, 18, 6, 20, 12, 21, 37, 38, 41, 42, 74, 22, 76, 25, 82, 26, 84, 44, 50, 52, 85, 149, 150, 153, 154, 165, 166, 169, 170, 298, 86, 300, 89, 306, 90, 308, 101, 330, 102, 332, 105, 338, 106, 340, 172, 178, 180, 202, 204, 210, 212, 341, 597, 598, 601, 602, 613, 614, 617, 618
Offset: 1

Views

Author

Scott R. Shannon, Feb 27 2022

Keywords

Comments

Numerous numbers can be immediately eliminated as possible terms in this sequence. Clearly any number whose binary string contains three or more consecutive 1's or 0's cannot be a term. Likewise any number ending with '11' binary cannot be a term as either the 1's appear in one pair, which is not allowed, or the final 1 is the first digit in the next pair, but that would force the next number to have 0 as its first digit, which is also not allowed. Also any number which matches the string XXAXX in binary cannot occur, where 'X' is either 0 or 1 and 'A' is an arbitrarily long string containing an odd number of 0's or 1's. Any such number would either have the first XX in a single pair, and if not, then the second XX would be.
This sequence is the binary equivalent of A345227. As it immediately reaches the regime where almost all pairs of digits must contain 0 and 1 it possibly offers insight into the behavior of A345227 when n >> 10^10 in that sequence.

Examples

			a(1) = 0 = 0_2, a(2) = 1 = 1_2 (the only way to use two numbers in one pair).
a(3) = 2 = 10_2 (the next smallest unused number to contain 1 then 0 and fill the next pair).
a(4) = 4 = 100_2 (the next smallest unused number to contain 1 then 0, which fills the next pair, and then a 0 in the second-next pair; note that 3 = 11_2 can never be a term).
a(5) = 5 = 101_2 (the next smallest unused number to contain a 1 to fill the pair started by a(4) and then 0 and 1 to fill the next pair).
a(6) = 9 = 1001_2 (the next smallest unused number to contain two pairs both of which contain 0 and 1 and fill the next two pairs; note that 6 = 110_2 and 7 = 111_2 would fill the next pair with two 1's while 8 = 1000_2 would fill the second-next pair with two 0's). Neither 7 nor 8 can ever be terms.
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

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