Pure Mathematical Solution || O(1) || Direct Formula By Observation
Observations\n        /\n        Let n = 1: ans = 1 + 1 + 1 + 1 + 1 = 5 \n        Let n = 2: ans = 5 + 4 + 3 + 2 + 1 = 15\n        Let n = 3: _ _ _ : a a _ -> 5
# Observations\n        /*\n        Let n = 1: ans = 1 + 1 + 1 + 1 + 1 = 5 \n        Let n = 2: ans = 5 + 4 + 3 + 2 + 1 = 15\n        Let n = 3: _ _ _ : a a _ -> 5 +a e _ -> 4 .....\n                   a _ _ : 5+4+3+2+1 = 15\n                   e _ _ : 4+3+2+1 = 10\n                   ans = 15 + 10 + 6 + 3 + 1 = 35\n                   \n        Let n = 4: _ _ _ _ : \n                   a _ _ _ : 15+10+6+3+1\n                   e _ _ _ : 10+6+3+1\n                   ans = 35 + 20 + 10 + 4 + 1 = 70\n        \n        ans(u)=1, ans(o)=n, ans(i)=ans(n-2)-ans(n-3)\n        ans(a)=ans(n-1), ans(e)=ans(n-1)-ans(n-2)\n\n        By solving : ans(a)=(x^4 + 6x^3 + 11x^2 + 6x)/24\n                     ans(e)=(x^3 + 3x^2 + 2x)/6\n                     ans(i)=(x^2 + x)/2\n        */\n\n\n# Code\n```\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        int four=pow(n,4),three=pow(n,3),two=pow(n,2);\n        int a = (four + 6*three + 11*two + 6*n)/24;\n        int e = (three + 3*two + 2*n)/6;\n        int i = (two + n)/2;\n        int o = n;\n        int u = 1;\n        return (a+e+i+o+u);\n    }\n};\n```
['Math', 'Combinatorics', 'C++']