"Hey, Harry Hogan," said the old man wearing a red baseball cap over his bald head. "Let me shake the hand of our next governor. I'm a Democrat but I can't wait to vote for you, Harry."

The old man got the name wrong, and he had his offices a bit confused. He was shaking hands with Lawrence J. (Larry) Hogan, who is running for county executive in Prince George's County. But the sentiment the old man expressed is one that Republican Hogan heard time and again as he campaigned yesterday through a picnic of senior citizens at Watkins Regional Park.

There were the three women from Bowie wearing "One of the People for Francois" buttons on their dresses who said they would vote for Hogan and at the same time support Democrats such as Councilman Francis Francois in the other local contests.

There was the woman passing out literature for Democratic Rep. Gladys Noon Spellman who told Hogan that he was a "savior." There was the man wearing a Lee-Hoyer hat who said he would never forget how Hogan helped

Hogan's popularity among voters of the other party has been documented by his 10-year history of electoral success in a county where three of every four voters are registered Democrats. The appeal is strong enough this year that he is leading the incumbent county executive, Democrat Winfield M. Kelly Jr., even in polls of Democratic voters.

But to face Kelly in November, Hogan must first win the Republican primary against Martin Aragona next week, and in that election the women from Bowie and the old man in the red baseball cap and all the thousands of other Democrats for Hogan will do him no good.

The Republican primary, as an aide to Aragona put it, "is not the real world." What it is, more than anything else, is a matter of subtraction.

Start with the figure 700,000, the approximate population of Prince George's County. Then subtract the 462,000 people who are either too young to vote or have not registered. Subtract another 186,000 voters who have registered as Democrats or independents. Chop off another 10,000 Republicans who have moved out of the county but have not been stricken from registration lists.

The figure is now 42,000. Of that number, about 30 percent probably will vote in the Sept. 12 primary.

"We expect 13,546 Republicans to vote in the primary," said William Green, a computer analyst who has spent the past several weeks studying voting patterns as Aragona's chief strategist. "The voting history of Republicans in this county shows that the turnout will be right around that figure."

Before the better-known Hogan surprised him by entering the race, Aragona had little regard for the number of voting Republicans. The millionaire building contractor from Oxon Hill had the money and the inclination then to base his campaign on television and radio advertising. He hired a high-powered public relations firm, Goodman and Associates of Baltimore, to carry his message for him.

"Then, when Hogan got in," Aragona said "we realized that the play called in the huddle didn't fit what was going on in the field. We adjusted, just like Tony Dorsett did on national television against the Baltimore Colts."

What Aragona did, in other words, is to narrow the focus of his campaign to the 13,546 or so Republicans who are expected to vote. Green, with the help of a few volunteers, examined computer printouts that showed as precisely as possible who these voters were, where they lived and how they voted in earlier years - for instance, in the 1974 Republican gubernatorial primary when Hogan lost to Louise Gore.

The Aragona organization then attempted to reach these likely voters with five mailings: an introductory letter; a slick brochure; specialized "issue" pamphlets; an 8-page leaflet and a sample ballot. In addition, three paid workers, several volunteers and Aragona and his wife, Marie, spent much of their time on the telephone calling the targeted voters.

"Door-knocking doesn't do much good in a Republican primary," said Aragons, who nevertheless claimed that he had knocked on at least 4,000 doors.

"The Democrats can park in a subdivision and walk from house to house. A Republican needs a driver to get him from one Republican household to another. The telephone is the thing. I'd like to spend every hour from now to election day on the telephone."

Hogan appears unconcerned by his opponent's concentrated vote-getting efforts. The 49-year-old former congressman has been outspent in the primary, $54,000 to $17,000 (about $35,000 of Aragona's campaign fund came from his own pocket). Hogan has not done any door-knocking or telephone canvassing and has sent out only one mailer.

"I expect to beat him and I don't expect it to be close," said Hogan, who has mentioned Aragona as little as possible during the campaign, concentrating his attention on Kelly.

"Marty is not a credible candidate. The Republicans don't take him seriously. I know people say overconfidence was my problem four years ago (when he lost the gubernatorial primary to Gore), but Aragona is not running a very good campaign."

Martin Aragona, the man who compared the county's Democratic machine to the Chicago of the 1920s ("You've got Bugsy Moran on one side of town and Al Capone on the other"), had a predictably colorful response to Hogan's statement. Said Aragona: "Hogan's going to get Gored again."