Perfect License Plates Perfect License Plates

Starting a few years ago, I made myself a little game while driving around: checking if nearby license plates are "perfect". It's relatively rare, but exciting when you find one. 

To check if a license plate is perfect:


Sum up the characters, with A = 1, B = 2, ...  Z = 26.
Take each consecutive chunk of numerals, and sum them; multiply each of these sums together. 


If the values in part 1 and part 2 are equal, congratulations! You've found a perfect license plate!

Examples

License plate: AB3C4F

Digits -&gt; 3 * 4 
        = 12
Chars  -&gt; A + B + C + F 
        = 1 + 2 + 3 + 6 
        = 12
12 == 12 -&gt; perfect!


License plate: G34Z7T

Digits -&gt; (3 + 4) * 7 
        = 49
Chars  -&gt; G + Z + T 
        = 7 + 26 + 20 
        = 53
49 != 53 -&gt; not perfect!


License plate: 10G61

Digits -&gt; (1 + 0) * (6 + 1)
        = 7
Chars  -&gt; G
        = 7
7 == 7 -&gt; perfect!


The Challenge

I used license plates of length 5 and 6 as examples, but this procedure is valid for any plate length. Your challenge is, for a given length N, return the number of perfect license plates of that length. For the purposes of the challenge, a valid license plate is any combination of digits 0-9 and characters A-Z. The plate must contain both a character and a numeral to be considered potentially perfect. For checking purposes, here are the values I got (though I can't be 100% about their correctness, hahaha) 

N &lt; 2: 0
N = 2: 18
N = 3: 355
N = 4: 8012 


Notes

If somehow it makes the problem simpler in your language, you may output the proportion of perfect license plates for a given N, to at least 2 significant digits.

N &lt; 2: 0
N = 2: 0.0138888...
N = 3: 0.0076088...
N = 4: 0.0047701...


OR, you may output the equivalent value mod 256

N &lt; 2: 0
N = 2: 18
N = 3: 99
N = 4: 76


Shortest wins!
Python 3.6, 150 bytes

f=lambda n,t=-1,p=-1,a=0:sum(f(n-1,*((t,c+p*(p&gt;=0),a),((t&lt;0 or t)*(p&lt;0 or p),-1,a-c))[c&lt;0])for c in range(-26,10))if n else 0&lt;(t&lt;0 or t)*(p&lt;0 or p)==a


results:

f(2) = 18
f(3) = 355
f(4) = 8012
f(5) = 218153


Ungolfed version with explanation:

digits=[*range(10)]
letters=[*range(1,27)]

def f(n, dt=-1, dp=-1, lt=0):
    if n:
        for d in digits:
            yield from f(n - 1,
                         dt,
                         d if dp &lt; 0 else dp + d,
                         lt
                         )

        for l in letters:
            yield from f(n - 1,
                         dp if dt &lt; 0 else dt if dp &lt; 0 else dt*dp,
                         -1,
                         lt + l
                         )
    else:
        yield 0 &lt; lt == (dt&lt;0 or dt)*(dp&lt;0 or dp)


The problem boils down to searching a tree in which each level of the tree corresponds to a position in a license plate number and each node has 36 children (10 digits and 26 letters).  The function does a recursive search of the tree, accumulating the values for the digits and letters as it goes.  

n is the number of levels to search. 
dp accumulates the sum of a group of digits.
dt accumulates the product of the digit sums.
lt accumulates the sum of the letter values.

For dp and dt, a value &lt; 0 indicates it is not initialized.


Golf included, converting the for loops to sums of generators:

sum(f(n-1, 
      dt,
      d if dp &lt; 0 else dp + d,
      lt) for d in digits)
+
sum(f(n-1,
      dp if dt&lt;0 else dt if dp&lt;0 else dt*dp,
      -1,
      lt+l) for l in letters)


Then combining the generators.  Encode letters, A to Z, as -1 to -26 and digits as 0 to 9.  So the sum becomes:

sum(f(n-1, *args) for c in range(-26, 10)),


where args is:

((dp if dt&lt;0 else dt if dp&lt;0 else dt*dp, -1, lt-l) if c &lt;0 else
 (dt, d if dp&lt;0 else dp+d, lt))


The rest of the golfing is converting the function to a lambda, shortening variable names, and simplifying expressions.