An apparatus for preparing an optimized aptamer sequence, wherein said apparatus comprises a data processing device comprising a hardware processor and non-transitory computer-readable medium, said medium comprising one or more programs, executed by the hardware processor, which comprise commands for:
- (1) extracting data of a single-stranded region, by excluding bases capable of forming a stem structure from the sequence of the nucleic acid molecule;
- and
- (2) searching a motif sequence from the single-stranded region, by weighing the appearance frequency of a specific sequence in the extracted data with an evaluated value of the affinity of the nucleic acid molecule for the target substance,
- and wherein said apparatus is configured to prepare and output an aptamer sequence that contains the region binding to the target substance, but which lacks one or more corresponding nucleotides that are present in the nucleic acid molecule and which are unnecessary for binding to the target substance.