General expression of finite, integer sequence, containing the ceiling function

42 Views Asked by At

I have limited familiarity with sequences in general, so please bear with me. During an algorithmic problem I encountered the following sequence, which is currently not listed in OEIS. Describing it in a loosely way:

  • for all integers $i$ from 1 up to N compute $a_i=\lceil \frac{N}{i} \rceil$. Keep $a_1$ as the first element of the sequence.
  • if $a_{i+1}=\lceil \frac{N}{i+1} \rceil \neq a_i$, then keep $a_{i+1}$ as the next element in the sequence

For example, with N=32, the sequence would be: $32,16,11,8,7,6,5,4,3,2,1$

With N=64 : $64,32,22,16,13,11,10,8,7,6,5,4,3,2,1$

We may also observe that if the sequence consists of $m$ elements, then $b_{m} = \lceil \frac{N}{b_1} \rceil = 1$, $b_{m-1} = \lceil \frac{N}{b_2} \rceil$, $b_{m-2} = \lceil \frac{N}{b_3} \rceil$, etc.

Any thoughts on its general expression?

A bit of info on the "Why?" : Suppose that you are given a specification of performing N operations and you can distribute these N operations to k machines, each one performing a single operation at a time. The single operation itself, cannot be split. Which numbers of machine parallelism are actually meaningful? If N=8 and you set k=7 machines parallelly, for the N operations to be completed it will take the same time as k=4 machines (1 to 7 completed in the first iteration, the 8th in the second VS 1 to 4 in the first iteration, 5 to 8 in the second). You have spent more machine resources, but did not decrease the time that the total of N operations need in order to be executed. However, not only divisors of N are meaningful. For N=8, k=3 is a valid option which results in faster computation over k=2.