@Dom has showed you how to work out a solution in general. I want to add a bit of detail to his answer that seems to have gotten lost.
Namely: musical note durations don't occur in a vacuum. The human ear tends to naturally group them into a hierarchy of equally-spaced beats. And while the notation may be general enough to allow such arbitrary fractions, they will not be heard that way. Indeed, the ear is pretty bad about precisely measuring the lengths of times relative to each other, unless they have a simple relationship to each other. In fact, the usual subdivision at each level of this rhythmic hierarchy is 2-4 sub-beats per beat. Trying to fit in more usually causes the beat to mentally subdivide. Five beats is often heard as a longer group of 3 beats followed by a shorter group of 2, six beats is two equal groups of three, and seven is oft treated as a group of 4 followed by a group of 3.
In the case of your 27-lets, since 27 = 33 you have a three-fold division into threes: three groups of three-groups-of-three. If this is an essential feature of the music (breaking into 27 beats) then you'll probably want to use a nine-beat measure as a starting place (there are time signatures that have nine beats in them). For example, in a 9/8 time signature, you would only need a single set of triplets over 16th notes in order to express this figure, and I dare say it would almost be comprehensible to a normal musician.
If, on the other hand, the number 27 has no special significance, and the only idea that you are trying to convey is two equally long notes divided by a very quick note, there is a much cleaner solution, which involves using a grace note between two half notes. In this case, the actual sequence of durations would be (0.5 - δ, δ, 0.5) where you have an arbitrary short value δ < 1/16. I played both of these approaches in my notation editor, and, with no other context, they sounded identical to my ears.
To expand this briefly to 81, you have four levels of a hierarchy dividing into three at each level (81 = 34). Once again, we decide to use a measure with nine beats. Each of these beats then divides into a nontuplet.
Say "diddly-diddly-diddly" as fast as possible. That is one nontuplet, representing one beat of music. Now repeat that a total of nine times (tap out an even beat for every three diddlies). That is one measure of nine beats, each divided into nontuplets.
Note that using this notation, I am not dividing a whole note into 4 quarters, but rather dividing the entire measure into nine quarters. Because of this, the total of the sum that you created would not add to a quarter note, but would add to 9/4 = 2.25 quarter notes.
Dividing into 1296 = 34 * 24 would require breaking one of the nontuplets into sixteenths, which strains all credibility of meaningfulness. Instead of having four levels of rhythmic hierarchy (which is already a lot), you now have eight levels! That's too deep for comprehension, even aside from the fact that the note are too short to have that level of precision.