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.

A276769 Next larger number having the same digits as n.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 111, 21, 31, 41, 51, 61, 71, 81, 91, 200, 112, 222, 32, 42, 52, 62, 72, 82, 92, 300, 113, 223, 333, 43, 53, 63, 73, 83, 93, 400, 114, 224, 334, 444, 54, 64, 74, 84, 94, 500, 115, 225, 335, 445, 555, 65, 75, 85, 95, 600, 116, 226, 336, 446, 556, 666, 76, 86, 96, 700
Offset: 1

Views

Author

David A. Corneth, Sep 20 2016

Keywords

Comments

This sequence can be used to find terms of A276633. Each number in base 10 can have 1024 sets of digits, either {0}, {1}, ..., or {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Some occur once or never in A276633. For each such set the least number having its digits can be chosen. Then from that set put the next higher number having the digits only of that set.

Examples

			No number between (exclusive) 31 and 113 has the digits of 31; {1, 3}. 113 has. Therefore, a(31) = 113.
		

Crossrefs

Cf. A276633.

Programs

  • Maple
    N:= 1000: # to get a(1)..a(m-1) where a(m) is the first term > N
    for s in combinat:-powerset({$0..9}) do R[s]:= NULL od:
    for n from 1 to N do
    s:= convert(convert(n,base,10),set);
    R[s]:= R[s], n;
    if R[s] <> n then A[R[s][-2]]:= n fi
    od:
    seq(A[i],i=1..min(remove(t-> A[t]::integer, [$1..N]))-1); # Robert Israel, Nov 08 2016
  • PARI
    a(n) = {my(m=vecsort(digits(n), ,8), i = n+1); while(vecsort(digits(i), ,8)!=m,i++); i}