Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Python 2, histocrat, ≤16 Python 2, histocrat, ≤16

[[[51002**3/6]]] 

The biggest hint is the promise that it won't work in Python 3. What's changed in Python 3? The biggest suspect is that the division operator returns a float in Python 3.

So I assume the solution is of the form ⌊αβ/n⌋ = c = 22111101102001, as exponentiation is the only short way to create huge numbers.

If {α, β, n} indeed forms a solution, then (cn)1/β ≈ α should be very close to an integer. Therefore I use the following to try to brute-force the {α, β} for each n:

(* Mathematica *)
n=2; Sort[Table[{N[Abs[k - Round@k] /. k -> (22111101102001*n)^(1/b), 12], b}, {b, 2, 50}]]
(* Output: {{0.00262542213622, 7}, ...}
 The first number is the "quality" of the solution, lower is better.
 the second number is β.
 Thus α ≈ (nc)^(1/β) = 89
 But (89^7)/2 = 22115667447764, which is still far away from the answer.
*)

The actual result quickly comes out when n = 6.

Python 2, histocrat, ≤16

[[[51002**3/6]]] 

The biggest hint is the promise that it won't work in Python 3. What's changed in Python 3? The biggest suspect is that the division operator returns a float in Python 3.

So I assume the solution is of the form ⌊αβ/n⌋ = c = 22111101102001, as exponentiation is the only short way to create huge numbers.

If {α, β, n} indeed forms a solution, then (cn)1/β ≈ α should be very close to an integer. Therefore I use the following to try to brute-force the {α, β} for each n:

(* Mathematica *)
n=2; Sort[Table[{N[Abs[k - Round@k] /. k -> (22111101102001*n)^(1/b), 12], b}, {b, 2, 50}]]
(* Output: {{0.00262542213622, 7}, ...}
 The first number is the "quality" of the solution, lower is better.
 the second number is β.
 Thus α ≈ (nc)^(1/β) = 89
 But (89^7)/2 = 22115667447764, which is still far away from the answer.
*)

The actual result quickly comes out when n = 6.

Python 2, histocrat, ≤16

[[[51002**3/6]]] 

The biggest hint is the promise that it won't work in Python 3. What's changed in Python 3? The biggest suspect is that the division operator returns a float in Python 3.

So I assume the solution is of the form ⌊αβ/n⌋ = c = 22111101102001, as exponentiation is the only short way to create huge numbers.

If {α, β, n} indeed forms a solution, then (cn)1/β ≈ α should be very close to an integer. Therefore I use the following to try to brute-force the {α, β} for each n:

(* Mathematica *)
n=2; Sort[Table[{N[Abs[k - Round@k] /. k -> (22111101102001*n)^(1/b), 12], b}, {b, 2, 50}]]
(* Output: {{0.00262542213622, 7}, ...}
 The first number is the "quality" of the solution, lower is better.
 the second number is β.
 Thus α ≈ (nc)^(1/β) = 89
 But (89^7)/2 = 22115667447764, which is still far away from the answer.
*)

The actual result quickly comes out when n = 6.

added 1024 characters in body
Source Link
kennytm
  • 7k
  • 20
  • 48

Python 2, histocrat, ≤16

[[[51002**3/6]]] 

The biggest hint is the promise that it won't work in Python 3. What's changed in Python 3 ? The biggest suspect is that the division operator returns a float in Python 3.

So I assume the solution is of the form ⌊αβ/n⌋ = c = 22111101102001, as exponentiation is the only short way to create huge numbers.

If {α, β, n} indeed forms a solution, then (cn)1/β ≈ α should be very close to an integer. Therefore I use the following to try to brute-force the {α, β} for each n:

(* Mathematica *)
n=2; Sort[Table[{N[Abs[k - Round@k] /. k -> (22111101102001*n)^(1/b), 12], b}, {b, 2, 50}]]
(* Output: {{0.00262542213622, 7}, ...}
 The first number is the "quality" of the solution, lower is better.
 the second number is β.
 Thus α ≈ (nc)^(1/β) = 89
 But (89^7)/2 = 22115667447764, which is still far away from the answer.
*)

The actual result quickly comes out when n = 6.

Python 2, histocrat, ≤16

[[[51002**3/6]]] 

Python 2, histocrat, ≤16

[[[51002**3/6]]] 

The biggest hint is the promise that it won't work in Python 3. What's changed in Python 3 ? The biggest suspect is that the division operator returns a float in Python 3.

So I assume the solution is of the form ⌊αβ/n⌋ = c = 22111101102001, as exponentiation is the only short way to create huge numbers.

If {α, β, n} indeed forms a solution, then (cn)1/β ≈ α should be very close to an integer. Therefore I use the following to try to brute-force the {α, β} for each n:

(* Mathematica *)
n=2; Sort[Table[{N[Abs[k - Round@k] /. k -> (22111101102001*n)^(1/b), 12], b}, {b, 2, 50}]]
(* Output: {{0.00262542213622, 7}, ...}
 The first number is the "quality" of the solution, lower is better.
 the second number is β.
 Thus α ≈ (nc)^(1/β) = 89
 But (89^7)/2 = 22115667447764, which is still far away from the answer.
*)

The actual result quickly comes out when n = 6.

Source Link
kennytm
  • 7k
  • 20
  • 48

Python 2, histocrat, ≤16

[[[51002**3/6]]] 

AltStyle によって変換されたページ (->オリジナル) /