One day there were 2 children and 4 adults who wanted to cross the river but there were electric eels. There is only one tiny boat and it can only hold 2 children, 1 adult or 1 child. They wanted to find the fastest way to get across the river. I am trying to figure out the quickest number of trips it would take. So first I noticed in order to get across faster, you would have to left the 2 children go first. If 1 adult starts then he/she has to go back again because he/she has to give the boat to someone else. And that is also a waste of 2 trips. First, you would have 2 children go. Then 1 child brings the boat back. The child gives the boat to 1 adult to cross. Then the adult gives the boat to the child and 1 child crosses. And it took 4 trips. Now there are 2 children on the same side and it repeats the pattern again with 2 children starting. This pattern continues until the last trip is with the 2 children going. In total it would take 17 trips because they have to get 4 adults across so they do 4x4+1 to get 17. I think the rule is number of adults times 4 and add 1 but I think this only works when there are 2 children (4a+1). So for 2 children and 4 adults to get across they need 17 trips.
Now there are 2 children on the same side so the pattern start again when 2 children go to B, 1 child goes back to A, 1 adult goes to B, and then the child goes to A (now 2 children are at A).