OFFSET
1,2
LINKS
C. Seggelin, Interesting Base Conversions.
EXAMPLE
a(12)=158 because 158 in base 9 is 185, a permutation of the digits of 158. a(19)=1135 because 1135 in base 6 is 5131. a(77)=30576 because 30576 in base 8 is 73560.
MAPLE
"replace all /n in the code below with backslash-n."; digListToNum := proc(L) local i, result; result := 0; for i from nops(L) to 1 by -1 do; result := result*10+L[i]; od; result; end; basePerm := proc(n) local b, nL, nbL, ok; nL := sort(convert(n, base, 10)); ok := false; for b from 2 to 9 do; nbL := sort(convert(n, base, b)); if nL=nbL then printf("%10d in base %2d = %10d./n", n, b, digListToNum(convert(n, base, b))); ok := true; fi; od; ok; end; basePermList := proc (endAt) local i, L; L := []; for i from 1 to endAt do; if basePerm(i) then L := [op(L), i] fi; od; L; end; basePermList(100000);
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Chuck Seggelin (barkeep(AT)plastereddragon.com), Nov 22 2003
STATUS
approved