The historian George Macaulay Trevelyan wrote in 1913 that he had two doctors: "My left leg and my right".

Now a report appears to show that the simple medicine of putting one foot in front of another is a potential defence against dementia and Alzheimer's.

Walking may protect the brain against shrinking and preserve memory in the elderly, according to research by US neurologists who monitored 300 volunteers over 13 years.

The data lends statistical authority to anecdotal findings, including the legendary perambulations of Alfred Wainwright, Benny Rothman and the Guardian's Harry Griffin.

Although very different in character – a grump, a communist warrior and an ex-brigadier – they lived for a combined total of 268 years thanks, in their own estimation, to lives spent largely on foot and outdoors.

The US study bears this out, with neurological tests on dementia-free people in Pittsburgh who agreed to log their walks and accept brain monitoring in 1995.

Tests nine years later, followed by a further round in 2008, showed that those who walked the most cut their risk of developing memory problems by half.

The study suggest that nine miles a week – or in the urban US terms of the data, 72 Pittsburgh city blocks – is the optimum distance for "neurological exercise".

The paper, published in Neurology, the online medical journal of the American Academy of Neurology, found no discernible bonus in going the extra mile after that.

The first round of scans showed that nine-mile walkers had larger brains than those who walked around for less.

After a further four years, 116 volunteers – 40% of the sample – had developed some dementia or cognitive impairment, with the effects 50% greater on those who walked only short distances and on non-walkers.

"Our results should encourage well-designed trials of physical exercise in older adults as a promising approach for preventing dementia and Alzheimer's disease," Dr Kirk Erickson, of Pittsburgh University, who led the study said.

"Brain size inevitably shrinks in late adulthood, which can cause memory problems.

"But if regular exercise in midlife could improve brain health, thinking and memory in later life, it would be one more reason to make regular exercise in people of all ages a public health imperative."

The study, supported by the US National Institute on Ageing, follows a range of other medical studies on the benefits of walking.

The Ramblers Association draws on reports from the British Heart Foundation, the UK and US departments of health, the Health Education Authority in the UK and a score of independent scientists to promote its range of organised walks.

These include shorter routes for elderly people and others designed for those with mental health problems. The group also campaigns for stiles and gates to be made more "elderly-friendly" to encourage the hobby.

Trevelyan, who lived to the age of 84, was a pioneer of youth hostelling and the national parks who bought five farms in Langdale to preserve the beauty of that part of the Lake District. Among his many other comments on his hobby was: "After a day's walking, everything has twice its usual value."

His enthusiasm was shared by the Danish philosopher Soren Kierkegaard, who wrote: "Above all, do not lose your desire to walk. Every day I walk myself into a state of well-being and walk away from every illness."

Ralph Waldo Emerson, too, put his health down to shoe leather, writing: "I measure your health by the number of shoes and hats and clothes you have worn out."