We say that a list is -guai if all the elements in that are in positions multiples of are themselves multiples of . For example, is 5-guai, because in positions 0, 5 and 10 (which are multiples of 5) the elements , , and , are also multiples of 5. Instead, is not 5-guai because in position 5 which is multiple of 5 there is an 8 that is not multiple of 5.
Implement the function @is_n_guai (f, n)@ that given a list
of non-negative integers and an integer
greater than zero returns boolean True if
is
-guai
and False otherwise.
Author: InfBesos
Generation: 2026-01-25T16:19:05.729Z
© Jutge.org, 2006–2026.
https://jutge.org