I need a list of integers to check if a variable has one of the values of the list.
If[ MemberQ[List,x], Green, Red]
The list contains integers and is characterized by two parameters, lets call them k and j, which should be variable.
If k=1
and j=1
then the list would look like this: {1,3,5,7,9,11,....until listmax}
If k=2
and j=3
then the List would look like this: {1,2,6,7,11,12,16,17,.....until listmax}
Whereas listmax
should be kept variable.
Generally speaking, the List contains the first k integers, then doesnt contain the next j integers, then contains the next k integers, then doesnt contain the next j integers and so on and so on.
In the end I need the List to decide whether x
has one of the values of the List, so if there is a way to skip the part where one has to define the list and can directly check if x has one of those values, that would also do the job.