login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A328447 Smallest representative of the class of numbers having the same digits as n up to permutation. 4
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 22, 23, 24, 25, 26, 27, 28, 29, 30, 13, 23, 33, 34, 35, 36, 37, 38, 39, 40, 14, 24, 34, 44, 45, 46, 47, 48, 49, 50, 15, 25, 35, 45, 55, 56, 57, 58, 59, 60, 16, 26, 36, 46, 56, 66, 67, 68, 69, 70, 17, 27, 37, 47, 57, 67 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Sort the digits in increasing order. If the list starts with a digit 0, move the smallest nonzero digit to the front.

Every term is in A179239. - David A. Corneth, Oct 17 2019

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

EXAMPLE

a(201) = 102: largest digits go to the end, but the smallest nonzero digit must go first.

MAPLE

f:= proc(n) local L, i, t;

  L:= sort(convert(n, base, 10));

  if L[1]=0 then

    t:= numboccur(0, L)+1;

    L:= [L[t], op(L[1..t-1]), op(L[t+1..-1])];

  fi;

  add(L[-i]*10^(i-1), i=1..nops(L))

end proc:

f(0):= 0:

map(f, [$0..100]);

MATHEMATICA

Array[FromDigits@ If[First@ # == 0, Flatten@ MapAt[Reverse, TakeDrop[#, 2], 1], #] &@ Sort@ IntegerDigits[#] &, 67] (* Michael De Vlieger, Oct 17 2019 *)

PROG

(PARI) A328447(n)={if(n=vecsort(digits(n)), n[1]|| for(k=2, #n, n[k]&&[n[1]=n[k], n[k]=0, break])); fromdigits(n)}

CROSSREFS

Cf. A179239, A004186 (largest representative of the class of n).

Sequence in context: A056963 A291769 A167129 * A107602 A272215 A323366

Adjacent sequences:  A328444 A328445 A328446 * A328448 A328449 A328450

KEYWORD

nonn,base,easy,look

AUTHOR

M. F. Hasler, Oct 15 2019

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 31 22:21 EDT 2020. Contains 334756 sequences. (Running on oeis4.)