Skip to main content
added 9 characters in body
Source Link
Manish Kundu
  • 5.3k
  • 2
  • 15
  • 47

Pyth, 2424 23 bytes

FkrPE8=Y+Y^@k1@k0;<eSYhEFkrPE8 aY^@k1@k0;<eSYhE

Try it online!Try it online!

Explanation

Fk    For loop with the iterator as k
E     Take first input.
PE    List of prime factors
rPE8  Run length encoding over the list, eg: [2, 2, 3] becomes [[2, 2], [1, 3]]
Y     Initialized to an empty list by default.
@k1   Element at index 1 of k.
@k0   Element at index 0 of k.
^     Apply exponentiation.
=Y+YaY  Add  Append element to Y
SY    Sort Y
e     Last element
hE    Take next input and increment by 1
<     Is it less than?

Pyth, 24 bytes

FkrPE8=Y+Y^@k1@k0;<eSYhE

Try it online!

Explanation

Fk    For loop with the iterator as k
E     Take first input.
PE    List of prime factors
rPE8  Run length encoding over the list, eg: [2, 2, 3] becomes [[2, 2], [1, 3]]
Y     Initialized to an empty list by default.
@k1   Element at index 1 of k.
@k0   Element at index 0 of k.
^     Apply exponentiation.
=Y+Y  Add element to Y
SY    Sort Y
e     Last element
hE    Take next input and increment by 1
<     Is it less than?

Pyth, 24 23 bytes

FkrPE8 aY^@k1@k0;<eSYhE

Try it online!

Explanation

Fk    For loop with the iterator as k
E     Take first input.
PE    List of prime factors
rPE8  Run length encoding over the list, eg: [2, 2, 3] becomes [[2, 2], [1, 3]]
Y     Initialized to an empty list by default.
@k1   Element at index 1 of k.
@k0   Element at index 0 of k.
^     Apply exponentiation.
aY    Append element to Y
SY    Sort Y
e     Last element
hE    Take next input and increment by 1
<     Is it less than?
added 529 characters in body
Source Link
Manish Kundu
  • 5.3k
  • 2
  • 15
  • 47

Pyth, 24 bytes

FkrPE8=Y+Y^@k1@k0;<eSYhE

Try it online!

Explanation

Fk    For loop with the iterator as k
E     Take first input.
PE    List of prime factors
rPE8  Run length encoding over the list, eg: [2, 2, 3] becomes [[2, 2], [1, 3]]
Y     Initialized to an empty list by default.
@k1   Element at index 1 of k.
@k0   Element at index 0 of k.
^     Apply exponentiation.
=Y+Y  Add element to Y
SY    Sort Y
e     Last element
hE    Take next input and increment by 1
<     Is it less than?

Pyth, 24 bytes

FkrPE8=Y+Y^@k1@k0;<eSYhE

Try it online!

Pyth, 24 bytes

FkrPE8=Y+Y^@k1@k0;<eSYhE

Try it online!

Explanation

Fk    For loop with the iterator as k
E     Take first input.
PE    List of prime factors
rPE8  Run length encoding over the list, eg: [2, 2, 3] becomes [[2, 2], [1, 3]]
Y     Initialized to an empty list by default.
@k1   Element at index 1 of k.
@k0   Element at index 0 of k.
^     Apply exponentiation.
=Y+Y  Add element to Y
SY    Sort Y
e     Last element
hE    Take next input and increment by 1
<     Is it less than?
Source Link
Manish Kundu
  • 5.3k
  • 2
  • 15
  • 47

Pyth, 24 bytes

FkrPE8=Y+Y^@k1@k0;<eSYhE

Try it online!