Median of a list and its squares

Form the list A=[1,2,,2024, 12,22,,20242]A = [\,1, 2, \dots, 2024,\ 1^2, 2^2, \dots, 2024^2\,] - that is, the integers 11 through 20242024 together with their squares (40484048 numbers in all, with repeats kept). What is the median of AA?

Show hints (2)+
  1. With 40484048 numbers, the median averages the 20242024th and 20252025th smallest. Count entries v\le v.
  2. That count is v+vv + \lfloor\sqrt v\rfloor. Solve it =2024= 2024 to find where the median sits.

Answer

Reveal answer →

1980.5

Want the full step-by-step worked solution? It's part of Premium - along with a worked solution for every question in the bank.

Asked at: Jane Street, Two Sigma

Related questions