Skip to main content
added 266 characters in body
Source Link
Sanchises
  • 9.5k
  • 1
  • 36
  • 61

Octave, 9727 x 153442 = 1484111934

'01234'(perms(1:5)'(4:445))

Try it online!

So, it turns out, naively generating all the permutations and then truncating to the shortest substring that is still a valid superpermutation is shorter than generating the shortest superpermutation. Sadly, this time the score is not a palindrome.

Octave, 97 x 153 = 14841

a=sym(9);while i<120
i=0;a+=1;q='01234';for t=q(perms(1:5))'
i+=any(regexp(char(a),t'));end
end
a

Try it online!

Entry updated for a few things

  • a++ is not implemented for symbolic numbers.
  • contains() is not implemented in Octave. Replaced with any(regexp()).
  • In the online link, I manually entered an a very close to the 153-length superpermutation. This allows for the solution to be verified.

Octave, 97 x 153 = 14841

a=sym(9);while i<120
i=0;a+=1;q='01234';for t=q(perms(1:5))'
i+=any(regexp(char(a),t'));end
end
a

Try it online!

Entry updated for a few things

  • a++ is not implemented for symbolic numbers.
  • contains() is not implemented in Octave. Replaced with any(regexp()).
  • In the online link, I manually entered an a very close to the 153-length superpermutation. This allows for the solution to be verified.

Octave, 27 x 442 = 11934

'01234'(perms(1:5)'(4:445))

Try it online!

So, it turns out, naively generating all the permutations and then truncating to the shortest substring that is still a valid superpermutation is shorter than generating the shortest superpermutation. Sadly, this time the score is not a palindrome.

Octave, 97 x 153 = 14841

a=sym(9);while i<120
i=0;a+=1;q='01234';for t=q(perms(1:5))'
i+=any(regexp(char(a),t'));end
end
a

Try it online!

Entry updated for a few things

  • a++ is not implemented for symbolic numbers.
  • contains() is not implemented in Octave. Replaced with any(regexp()).
  • In the online link, I manually entered an a very close to the 153-length superpermutation. This allows for the solution to be verified.
Post Undeleted by Sanchises
added 266 characters in body
Source Link
Sanchises
  • 9.5k
  • 1
  • 36
  • 61

Octave, 9397 x 153 = 1422914841

a=sym(9);while i<120
i=0;a++;q='01234';fori=0;a+=1;q='01234';for t=q(perms(1:5))'
i+=containsi+=any(regexp(char(a),t'));end
end
a

Try it online!Try it online!

Brute force solution with arbitrary length (symbolic) integer. But wait!, you say, you have not initialized i. I abuse here that Octave can use i both as the complex number (smaller than 120) andEntry updated for a variable.few things

Please get back with me until the heat death of the universe to check the results.

  • a++ is not implemented for symbolic numbers.
  • contains() is not implemented in Octave. Replaced with any(regexp()).
  • In the online link, I manually entered an a very close to the 153-length superpermutation. This allows for the solution to be verified.

Octave, 93 x 153 = 14229

a=sym(9);while i<120
i=0;a++;q='01234';for t=q(perms(1:5))'
i+=contains(char(a),t');end
end
a

Try it online!

Brute force solution with arbitrary length (symbolic) integer. But wait!, you say, you have not initialized i. I abuse here that Octave can use i both as the complex number (smaller than 120) and a variable.

Please get back with me until the heat death of the universe to check the results.

Octave, 97 x 153 = 14841

a=sym(9);while i<120
i=0;a+=1;q='01234';for t=q(perms(1:5))'
i+=any(regexp(char(a),t'));end
end
a

Try it online!

Entry updated for a few things

  • a++ is not implemented for symbolic numbers.
  • contains() is not implemented in Octave. Replaced with any(regexp()).
  • In the online link, I manually entered an a very close to the 153-length superpermutation. This allows for the solution to be verified.
Post Deleted by Sanchises
Oops
Source Link
Sanchises
  • 9.5k
  • 1
  • 36
  • 61

Octave, 9193 x 153 = 1392314229

a=sym(9);while i<6i<120
i=0;a++;q='01234';for t=q(perms(1:5))'
i+=contains(char(a),t');end
end
a

Try it online!

Brute force solution with arbitrary length (symbolic) integer. But wait!, you say, you have not initialized i. I abuse here that Octave can use i both as the complex number (smaller than 6120) and a variable.

Please get back with me until the heat death of the universe to check the results.

Octave, 91 x 153 = 13923

a=sym(9);while i<6
i=0;a++;q='01234';for t=q(perms(1:5))'
i+=contains(char(a),t');end
end
a

Try it online!

Brute force solution with arbitrary length (symbolic) integer. But wait!, you say, you have not initialized i. I abuse here that Octave can use i both as the complex number (smaller than 6) and a variable.

Please get back with me until the heat death of the universe to check the results.

Octave, 93 x 153 = 14229

a=sym(9);while i<120
i=0;a++;q='01234';for t=q(perms(1:5))'
i+=contains(char(a),t');end
end
a

Try it online!

Brute force solution with arbitrary length (symbolic) integer. But wait!, you say, you have not initialized i. I abuse here that Octave can use i both as the complex number (smaller than 120) and a variable.

Please get back with me until the heat death of the universe to check the results.

Source Link
Sanchises
  • 9.5k
  • 1
  • 36
  • 61
Loading