for i = 0 to 3 for j = 1 to 5 n = (i * 5) + j c = c + 1 print "p("; using("##", n); ") = "; using("##", Pancake(n)); " "; if c mod 5 = 0 then print next j next i function Pancake(n) gap = 2 sum = 2 adj = -1 while sum < n adj = adj + 1 gap = (gap * 2) - 1 sum = sum + gap wend Pancake = n + adj end function