Resumen: In this paper we study the multiplicative function ¿k,¿(n) that counts the number of solutions of the equation x1 2+...+xk 2=¿(modn) in (Z/nZ)k. In particular we give closed explicit formulas for ¿k,¿(ps). This leads to an algorithm with an arithmetic complexity of constant order that improves previous work by Tóth [10] and completes the quadratic case considered by Li and Ouyang in [8]. Idioma: Inglés DOI: 10.1016/j.jnt.2018.09.015 Año: 2018 Publicado en: JOURNAL OF NUMBER THEORY 200 (2018), 427 - 440 ISSN: 0022-314X Factor impacto JCR: 0.684 (2018) Categ. JCR: MATHEMATICS rank: 181 / 313 = 0.578 (2018) - Q3 - T2 Factor impacto SCIMAGO: 0.837 - Algebra and Number Theory (Q1)