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.

This page as a plain text file.
%I A276769 #32 Nov 08 2016 22:20:19
%S A276769 11,22,33,44,55,66,77,88,99,100,111,21,31,41,51,61,71,81,91,200,112,
%T A276769 222,32,42,52,62,72,82,92,300,113,223,333,43,53,63,73,83,93,400,114,
%U A276769 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
%N A276769 Next larger number having the same digits as n.
%C A276769 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.
%H A276769 Robert Israel, <a href="/A276769/b276769.txt">Table of n, a(n) for n = 1..10000</a>
%e A276769 No number between (exclusive) 31 and 113 has the digits of 31; {1, 3}. 113 has. Therefore, a(31) = 113.
%p A276769 N:= 1000: # to get a(1)..a(m-1) where a(m) is the first term > N
%p A276769 for s in combinat:-powerset({$0..9}) do R[s]:= NULL od:
%p A276769 for n from 1 to N do
%p A276769 s:= convert(convert(n,base,10),set);
%p A276769 R[s]:= R[s], n;
%p A276769 if R[s] <> n then A[R[s][-2]]:= n fi
%p A276769 od:
%p A276769 seq(A[i],i=1..min(remove(t-> A[t]::integer, [$1..N]))-1); # _Robert Israel_, Nov 08 2016
%o A276769 (PARI) a(n) = {my(m=vecsort(digits(n), ,8), i = n+1); while(vecsort(digits(i), ,8)!=m,i++); i}
%Y A276769 Cf. A276633.
%K A276769 nonn,base,easy,look
%O A276769 1,1
%A A276769 _David A. Corneth_, Sep 20 2016