Solution 1:

The example given is not parenthetical:

(i) I need a (memorable) idiom.

A parenthesis is a remark which you insert into the middle of a sentence as if you are interrupting yourself. A parenthesis contributes to the meaning of the sentence but interrupts and stands outside its syntax. In writing, we typically use curved brackets, dashes, or commas to mark a parenthesis.

The syntax of the example sentence is not interrupted by the word memorable. Instead, the word memorable functions as an adjective modifying idiom. Consequently, the pronunciation rule applies to the word memorable and the article to use is a.

Compare this variation:

(ii) I need an (well, if I need anything at all) idiom.

Not an example of great writing, to be sure. But it shows how a parenthesis interrupts and stands outside the syntax of a sentence. The phrase “well, if I need anything at all” is not part of the noun phrase “an idiom”. The pronunciation rule still applies, but it applies to the word idiom and the article to use is an. This is true even though you would not normally pair an with well. You would, for instance, say:

(iii) I need a well known idiom.

The difference is that well is parenthetical only in example (ii) above.

Solution 2:

The a/an rule is based purely on sound. Would you say the words inside the parentheses if you were reading the sentence out loud? If yes, then you use the first word in the parentheses to decide whether or not to use an or a. If not, then—wait, what do you mean you wouldn’t say the words in parentheses?!

Solution 3:

A bracket only means that the word or phrase inside is less important or in some cases less relevant. But in any case that does not exclude bracketed words from the general sentence structure. Therefore, in this case the preferred way is:

I need a (memorable) idiom.

But you must understand that this is only the preferred way, not necessarily the right way. English is a rapidly growing and changing language and has numerous styles and methods. Sometimes more than one way can be called "right". And in my opinion both examples may be correct grammatically.

Solution 4:

You choose "an" vs. "a" based on the following word, be it in brackets or parentheses or anything else. Having the word in (parentheses) doesn't change this any more than having a word in "quotes" or italics does.

Solution 5:

As a practical matter, I try to match the a/an status of first word enclosed in parentheses and the first word on the other side of them. Thus, in this instance, I might try:

I need an (easy-to-remember) idiom.

or:

I need an (unforgettable) idiom.

If no available alternative adequately expressed my intended meaning, I would simply drop the parentheses:

I need a memorable idiom.

or rework the sentence to avoid the break after the indefinite article:

I need an idiom (memorable preferred).

I call my policy "practical" because I suspect that a mismatch—justifiable or not on appeal to logic or to outside authorities—would be distracting to a certain number of readers, and I would rather have them focus on what I'm trying to say than ponder whether I've used the right indefinite article.

Since the trick of enclosing a word or phrase in parentheses for effect isn't high on my list of essential literary tools, I don't mind using it after a/an only when the preceding indefinite article suits both the first word in parentheses and the first word beyond them.