Tricky Google interview question

前端 未结 21 1678
花落未央
花落未央 2020-12-22 15:39

A friend of mine is interviewing for a job. One of the interview questions got me thinking, just wanted some feedback.

There are 2 non-negative integers: i and j. Gi

21条回答
  •  温柔的废话
    2020-12-22 15:59

    This is the relevant entry at OEIS.

    It seems to be possible to obtain the ordered sequence by generating the first few terms, say

    1 2 4 5

    and then, starting from the second term, multiplying by 4 and 5 to get the next two

    1 2 4 5 8 10

    1 2 4 5 8 10 16 20

    1 2 4 5 8 10 16 20 25

    and so on...

    Intuitively, this seems correct, but of course a proof is missing.

提交回复
热议问题