[go: nahoru, domu]

login
A276769
Next larger number having the same digits as n.
3
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,1
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.
LINKS
EXAMPLE
No number between (exclusive) 31 and 113 has the digits of 31; {1, 3}. 113 has. Therefore, a(31) = 113.
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
PROG
(PARI) a(n) = {my(m=vecsort(digits(n), , 8), i = n+1); while(vecsort(digits(i), , 8)!=m, i++); i}
CROSSREFS
Cf. A276633.
Sequence in context: A171901 A033283 A044851 * A160861 A302575 A302801
KEYWORD
nonn,base,easy,look
AUTHOR
David A. Corneth, Sep 20 2016
STATUS
approved