Given an array that can contain both integers and other nested arrays of integers, write a recursive function that returns the sum of all integers in the nested array structure.
For example, given the input:
[1, [2, [3, 4], 5], 6]
Your function should return 21
(i.e., 1 + 2 + 3 + 4 + 5 + 6).
Note: February 2 is Groundhog Day, a day when events tend to repeat. In a similar way, nested arrays may have elements that repeat the pattern of containing more arrays. Use recursion to flatten these repetitions and compute the total sum.
Happy coding!