The push to prevent skin cancer may have come with unintended consequences—impaired brain function because of a deficiency of vitamin D. The “sunshine vitamin” is synthesized in our skin when we are exposed to direct sunlight, but sunblock impedes this process. And although vitamin D is well known for promoting bone health and regulating vital calcium levels—hence its addition to milk—it does more than that. Scientists have now linked this fat-soluble nutrient’s hormonelike activity to a number of functions throughout the body, including the workings of the brain.

“We know there are receptors for vitamin D throughout the central nervous system and in the hippocampus,” said Robert J. Przybelski, a doctor and research scientist at the University of Wisconsin School of Medicine and Public Health. “We also know vitamin D activates and deactivates enzymes in the brain and the cerebrospinal fluid that are involved in neurotransmitter synthesis and nerve growth.” In addition, animal and laboratory studies suggest vitamin D protects neurons and reduces inflammation.

Two new European studies looking at vitamin D and cognitive function have taken us one step further. The first study, led by neuroscientist David Llewellyn of the University of Cambridge, assessed vitamin D levels in more than 1,700 men and women from England, aged 65 or older. Subjects were divided into four groups based on vitamin D blood levels: severely deficient, deficient, insufficient (borderline) and optimum, then tested for cognitive function.

The scientists found that the lower the subjects’ vitamin D levels, the more negatively impacted was their perform­ance on a battery of mental tests. Compared with people with optimum vitamin D levels, those in the lowest quartile were more than twice as likely to be cognitively impaired.

A second study, led by scientists at the University of Manchester in England and published online this past May, looked at vitamin D levels and cognitive performance in more than 3,100 men aged 40 to 79 in eight different countries across Europe. The data show that those people with lower vitamin D levels exhibited slower information-processing speed. This correlation was particularly strong among men older than 60 years.

“The fact that this relationship was established in a large-scale, clinical human study is very important,” Przybelski says, “but there’s still a lot we don’t know.”

Although we now know that low levels of vitamin D are associated with cognitive impairment, we do not know if high or optimum levels will lessen cognitive losses. It is also unclear if giving vitamin D to those who lack it will help them regain some of these high-level functions.

Because cognitive impairment is often a precursor for dementia and Alzheimer’s disease, vitamin D is a hot topic among Alzheimer’s scientists, who are racing to answer these questions. Przybelski, for example, is planning a study of vitamin D supplements in healthy, normal elderly adults living in an assisted-living community to see if it will affect their incidence of Alzheimer’s in the long term.

So how much is enough vitamin D? Experts say 1,000 to 2,000 IU daily—about the amount your body will synthesize from 15 to 30 minutes of sun exposure two to three times a week—is the ideal range for almost all healthy adults. Keep in mind, however, that skin color, where you live and how much skin you have exposed all affect how much vitamin D you can produce.