[2303.01673] Near Optimal Memory-Regret Tradeoff for Online Learning