Chef and Ingredients - CHFING

When will be the editorial of Chef and Ingredients be out…??

I have solved it partially and want to know what pattern i missed.

There are lot of threads related to this in forum, they posted problems as well as solutions, try looking on these:

@codingisez I have seen these threads already but i was asking for a proper editorial with proper explanation and approach for the problem, hope you got my point :slight_smile:

1 Like

Ok, if you to see pattern, just use pen paper take examples like 11,12,13 and 20,21,22,23 Something like this, and then find the numbers which you can’t get by using operations, you will find there will be a basic decreasing AP series, with common difference and first term depending on N as well as K.

You might solved it partially, because there will be AP of d=-1. when n=2. And there is no better way to understand pattern then using pen paper.
Just see, a1=2*k-(k+n-1)-1, because for finding next minimum number you can simple find multiple of k, for example, 11 12 13… next term will be 11+11, so numbers you can get are, 14,15,16,17,18,19,20,21, numbers are 8 i.e. 2*k-13 -1.
Hope this would help.

In the case where N >= K, only the first K-1 values are inaccessible, because subsequent blocks either overlap (N > K) or meet without gaps (N = K).

In other cases, the inaccessible blocks of numbers are of length (K - 1) - J * (N - 1), starting from J = 0 and continuing until they disappear. For example, for K = 6, N = 3 the unreachable values are * in the sequence * * * * * 6 7 8 * * * 12 13 14 15 16 * 18 19 20 21 etc.

This is a linear sequence, whose total can be split into (N-1) times the sum of the numbers from 1 to M = (K-1) / (N-1), plus a constant multiple of (M+1).