a, HSD induces deficits in recognition (nonspatial) memory as assessed by the novel object test, first observed after 12 weeks (diet: ⋆P < 0.0001, time: ⋆P = 0.0046; 8 weeks: ND and SD n = 12 and 15 mice, respectively; 12 weeks: ND and HSD n = 15 mice per group; 24 weeks: ND and HSD n = 16 mice per group; two-way ANOVA and Tukey’s test). Total exploration time was not affected (P > 0.05). b, The deficit in novel object recognition is rescued by returning to normal diet for 4 weeks; ⋆P = 0.0137 vs. ND; ND n = 8 mice; HSD and HSD→ND n = 7 mice per group; one-way ANOVA and Tukey’s test). c, HSD (12 weeks) alters spatial memory, as assessed by the Barnes maze test. No differences in the latency to find the escape hole or distance traveled are observed during training (days 1–3). At days 4 and 5 latency and distance traveled are increased in the HSD group, suggesting a deficit in spatial memory (diet: ⋆P = 0.045, time: ⋆P < 0.0001; ND and HSD n = 18 and 15 mice, respectively; repeated-measures two-way ANOVA and Tukey’s test). d, The ability to build a nest (nesting behavior), reflecting activities of daily living in rodents, is altered in mice fed HSD for 12 weeks, as indicated by a lower nest score (see Methods) and increased amount of untorn nesting material (nest score: ⋆P = 0.0267 HSD vs. ND; untorn weight: ⋆P = 0.0254 HSD vs. ND, n = 15 mice per group; two-tailed Mann–Whitney U test and two-tailed unpaired t test). Data are expressed as mean ± s.e.m.