Answer by Kevin Cruijssen for All the Xenodromes
05AB1E, 8 bytesmÝʒIвDÙQTry it online or verify all test cases.†Explanation:m # Push the (implicit) input to the power of the (implicit) input: nⁿÝ # Pop and push a list in the range [0,nⁿ]ʒ # Filter...
View ArticleAnswer by matteo_c for All the Xenodromes
Haskell, 100 80 bytes-20 bytes thanks to @Laikonif k=[n|n<-[0..k*k^k],let x#0=1>0;x#n|m<-mod n k=notElem m x&&(m:x)#div n k,[]#n]Try it online!
View ArticleAnswer by Shaggy for All the Xenodromes
Japt, 13 10 bytespU ÇìU'âÃâTry itpU ÇìU'âÃâ :Implicit input of integer UpU :Raised to the power of itselfÇ :Map the range [0,U**U)ìU : Convert to base U digit array'â : Deduplicate and convert back to...
View ArticleAnswer by emanresu A for All the Xenodromes
Vyxal, 7 byteseʁ'?τÞuTry it Online!ʁ # Range(0, e # n**n' # Filtered by... ?τ # Convert to base nÞu # All unique?
View ArticleAnswer by Kamil Drakari for All the Xenodromes
Japt, 14 byteso à cá mìU âñTry itExplanation:o à cá mìU âño # Get the range [0...input]à # Find all arrays containing unique items from that range cá # Find all orderings for each of those arrays m #...
View ArticleAnswer by Seggan for All the Xenodromes
Vyxal, 14 13 bytesʁṖƛÞSƛṖ⁰vβ]fUTry it Online!ʁṖƛÞSƛṖ⁰vβ]fUʁ # Range [0, n)Ṗƛ ] # For each permutation:ÞSƛ # For each sublist in the permutation:Ṗ # Generate the permutations of that v # For each...
View ArticleAnswer by Jordan for All the Xenodromes
Ruby, 73 bytes->n,*a{i=-1n>1?(0..n**n).filter_map{i+=1d=i.digits(n)i if d==d&d}:[0]}Attempt This Online!
View ArticleAnswer by Greg Martin for All the Xenodromes
Mathematica, 48 55 bytesUnion[(x x~FromDigits~#)/@Permutations[Range@#-1,#]]&(The triple space between the xs needs to be replaced by the 3-byte character \uF4A1 to make the code work.)Unnamed...
View ArticleAnswer by Lynn for All the Xenodromes
Python 2, 87 bytesn=input()for x in range(n**n): s={n};a=x while{a%n}|s>s:s|={a%n};a/=n print-~-a*`x`Prints extra blank lines for non-xenodromes:golf % python2.7 xenodromes.py...
View ArticleAnswer by Brad Gilbert b2gills for All the Xenodromes
Perl 6, 47 bytes{(0..$_**$_).grep: !*.polymod($_ xx*).repeated}Returns a Seq. ( Seq is a basic Iterable wrapper for Iterators )With an input of 16 it takes 20 seconds to calculate the 53905th element...
View ArticleAnswer by JungHwan Min for All the Xenodromes
Mathematica, 59 48 bytesSelect[Range[#^#]-1,xMax[x~DigitCount~#]==1]&Contains U+F4A1 "Private Use" characterExplanationRange[#^#]-1Generate {1, 2, ..., n^n}. Subtract 1. (yields {0, 1, ..., n^n -...
View ArticleAnswer by Dennis for All the Xenodromes
Jelly, 9 8 bytesð*ḶbQ€QḅThanks to @JonathanAllan for golfing off 1 byte!Try it online! or verify all test cases.How it worksð*ḶbQ€Qḅ Main link. Argument: nð Make the chain dyadic, setting both left and...
View ArticleAnswer by Neil for All the Xenodromes
Batch, 204 200 bytes@set/an=%1,m=1@for /l %%i in (1,1,%1)do @set/am*=n@for /l %%i in (0,1,%m%)do @set/ab=0,j=i=%%i&call:l@exit/b:l@set/a"f&=b^=f=1<<j%%n,j/=n"@if %f%==0 exit/b@if %j% gtr...
View ArticleAnswer by Neil for All the Xenodromes
JavaScript (ES7), 86 bytesn=>{a=[];for(i=n**n;i--;j||a.unshift(i))for(j=i,b=0;(b^=f=1<<j%n)&f;j=j/n|0);return a}
View ArticleAnswer by FryAmTheEggman for All the Xenodromes
Pyth, 8 bytesf{IjTQU^Filters the numbers in [0, n^n - 1] on having no duplicate elements in base n. The base conversion in Pyth will work with any base, but since this looks at a very quickly...
View ArticleAnswer by Jonathan Allan for All the Xenodromes
Jelly, 12 bytes*`ḶbµQ⁼$Ðfḅ³TryItOnline!Will work for any n, given enough memory, Jelly's base conversion is not restrictive.How?*`ḶbµQ⁼$Ðfḅ³ - Main link: nµ - monadic chain separation* - exponentiation...
View ArticleAll the Xenodromes
IntroductionA xenodrome in base n is an integer where all of its digits in base n are different. Here are some OEIS sequences of xenodromes.For example, in base 16, FACE, 42 and FEDCBA9876543210 are...
View Article