Skip to main content
added 14 characters in body
Source Link
lyxal
  • 35.6k
  • 2
  • 69
  • 148

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 8 bytes

K~æ~Ǒ$ẋf 

Try it Online!

Explained

K~æ~Ǒ$ẋfʀ~æ~Ǒ$ẋf K~æʀ~æ # From the divisorsall ofnumbers in the inputrange [0, input], keep only those that are prime ~Ǒ # Without popping anything, get the multiplicity of each prime divisor - this leaves the stack as [divisors, multiplicities] $ẋ # Swap the two items and repeat each divisor multiplicity times f # Flatten and output that 

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 8 bytes

K~æ~Ǒ$ẋf 

Try it Online!

Explained

K~æ~Ǒ$ẋf K~æ # From the divisors of the input, keep only those that are prime ~Ǒ # Without popping anything, get the multiplicity of each prime divisor - this leaves the stack as [divisors, multiplicities] $ẋ # Swap the two items and repeat each divisor multiplicity times f # Flatten and output that 

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 8 bytes

K~æ~Ǒ$ẋf 

Try it Online!

Explained

ʀ~æ~Ǒ$ẋf ʀ~æ # From the all numbers in the range [0, input], keep only those that are prime ~Ǒ # Without popping anything, get the multiplicity of each prime divisor - this leaves the stack as [divisors, multiplicities] $ẋ # Swap the two items and repeat each divisor multiplicity times f # Flatten and output that 
deleted 462 characters in body
Source Link
lyxal
  • 35.6k
  • 2
  • 69
  • 148

VyxalVyxal, 1 byte

ǐ 

Try it Online!Try it Online!

Just the built-in. But that's boring, so

VyxalVyxal, 1616 8 bytes

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;fK~æ~Ǒ$ẋf 

Try it Online at your own risk!

It is horrendously slow for large numbers, but it worksTry it Online!

Explained

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;fK~æ~Ǒ$ẋf ʀǎ K~æ # nth prime for each item inFrom the rangedivisors [0of ...the input - 1] :£ , keep #only putthose that into the register while leaving it on theare stackprime   $vǑ   # Without popping #anything, get the divisbiltymultiplicity of each prime into the input ¥Z # anddivisor zip- thatthis withleaves the register ƛ ; # for each item in that zipped list: (each item is: [divisbilty, prime factor]) ÷w  # stack pushas divisbilty[divisors, [prime_factor]multiplicities]   $ẋ  #  Swap the two items and repeat [prime_factor]each divisibilitydivisor multiplicity times   f  # flatten theFlatten unholyand messoutput that results from doing the above 

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 bytes

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f 

Try it Online at your own risk!

It is horrendously slow for large numbers, but it works

Explained

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f ʀǎ  # nth prime for each item in the range [0 ... input - 1] :£  # put that into the register while leaving it on the stack   $vǑ  # get the divisbilty of each prime into the input ¥Z # and zip that with the register ƛ ; # for each item in that zipped list: (each item is: [divisbilty, prime factor]) ÷w  #  push divisbilty, [prime_factor]   $ẋ  #  and repeat [prime_factor] divisibility times   f  # flatten the unholy mess that results from doing the above 

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 8 bytes

K~æ~Ǒ$ẋf 

Try it Online!

Explained

K~æ~Ǒ$ẋf K~æ # From the divisors of the input, keep only those that are prime  # Without popping anything, get the multiplicity of each prime divisor - this leaves the stack as [divisors, multiplicities] $ẋ # Swap the two items and repeat each divisor multiplicity times f # Flatten and output that 
Aligned code
Source Link
emanresu A
  • 46.2k
  • 5
  • 112
  • 257

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 bytes

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f 

Try it Online at your own risk!

It is horrendously slow for large numbers, but it works

Explained

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f ʀǎ # nth prime for each item in the range [0 ... input - 1] :£ # put that into the register while leaving it on the stack $vǑ # get the divisbilty of each prime into the input ¥Z # and zip that with the register ƛ ƛ ; # for each item in that zipped list: (each item is: [divisbilty, prime factor]) ÷w ÷w # push divisbilty, [prime_factor] $ẋ $ẋ # and repeat [prime_factor] divisibility times f # flatten the unholy mess that results from doing the above 

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 bytes

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f 

Try it Online at your own risk!

It is horrendously slow for large numbers, but it works

Explained

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f ʀǎ # nth prime for each item in the range [0 ... input - 1] :£ # put that into the register while leaving it on the stack $vǑ # get the divisbilty of each prime into the input ¥Z # and zip that with the register ƛ ; # for each item in that zipped list: (each item is: [divisbilty, prime factor]) ÷w # push divisbilty, [prime_factor] $ẋ # and repeat [prime_factor] divisibility times f # flatten the unholy mess that results from doing the above 

Vyxal, 1 byte

ǐ 

Try it Online!

Just the built-in. But that's boring, so

Vyxal, 16 bytes

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f 

Try it Online at your own risk!

It is horrendously slow for large numbers, but it works

Explained

ʀǎ:£$vǑ¥Zƛ÷w$ẋ;f ʀǎ # nth prime for each item in the range [0 ... input - 1] :£ # put that into the register while leaving it on the stack $vǑ # get the divisbilty of each prime into the input ¥Z # and zip that with the register ƛ ; # for each item in that zipped list: (each item is: [divisbilty, prime factor]) ÷w # push divisbilty, [prime_factor] $ẋ # and repeat [prime_factor] divisibility times f # flatten the unholy mess that results from doing the above 
Source Link
lyxal
  • 35.6k
  • 2
  • 69
  • 148
Loading