Squares with Three Nonzero Digits



We determine all integers n such that n2 has at most three base-q digits for q ∈ {2, 3, 4, 5, 8, 16}. More generally, we show that all solutions to equations of the shape
$$\displaystyle{Y ^{2} = t^{2} + M \cdot q^{m} + N \cdot q^{n},}$$
where q is an odd prime, n > m > 0 and t2, | M |, N < q, either arise from “obvious” polynomial families or satisfy m ≤ 3. Our arguments rely upon Padé approximants to the binomial function, considered q-adically.

1991 Mathematics Subject Classification.

Primary 11D61 Secondary 11A63 11J25 



The authors are grateful to the referees for pointing out a number of errors, typographical, and otherwise. The authors were supported in part by grants from NSERC. The second author (Adrian-Maria Scheerer) was supported by the Austrian Science Fund (FWF): I 1751-N26; W1230, Doctoral Program “Discrete Mathematics”; and SFB F 5510-N26.


  1. 1.
    M. Bauer, M. Bennett, Application of the hypergeometric method to the generalized Ramanujan-Nagell equation. Ramanujan J. 6, 209–270 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    M. Bennett, Perfect powers with few ternary digits. Integers 12(6), 1159–1166 (2012)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    M. Bennett, Y. Bugeaud, Perfect powers with three digits. Mathematika 60, 66–84 (2014)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    M. Bennett, A. Ghadermarzi, Mordell’s equation: a classical approach. LMS J. Comput. Math. 18, 633–646 (2015)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    M. Bennett, Y. Bugeaud, M. Mignotte, Perfect powers with few binary digits and related Diophantine problems II. Math. Proc. Camb. Philos. Soc. 153, 525–540 (2012)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    M. Bennett, Y. Bugeaud, M. Mignotte, Perfect powers with few binary digits and related Diophantine problems. Ann. Sc. Norm. Super. Pisa Cl. Sci. XII, 941–953 (2013)Google Scholar
  7. 7.
    F. Beukers, On the generalized Ramanujan–Nagell equation. I. Acta Arith. 38, 389–410 (1980/1981)Google Scholar
  8. 8.
    F. Beukers, On the generalized Ramanujan–Nagell equation. II. Acta Arith. 39, 113–123 (1981)MathSciNetzbMATHGoogle Scholar
  9. 9.
    C. Bright, Solving Ramanujan’s Square Equation Computationally (2007), pp. 1–4,
  10. 10.
    P. Corvaja, U. Zannier, On the Diophantine equation f(a m, y) = b n. Acta Arith. 94, 25–40 (2000)Google Scholar
  11. 11.
    P. Corvaja, U. Zannier, Finiteness of odd perfect powers with four nonzero binary digits. Ann. Inst. Fourier (Grenoble) 63(2), 715–731 (2013)Google Scholar
  12. 12.
    H. Delange, Sur la fonction sommatoire de la fonction “somme des chiffres”. Enseign. Math. 21, 31–47 (1975)MathSciNetzbMATHGoogle Scholar
  13. 13.
    K. Hare, S. Laishram, T. Stoll, Stolarsky’s conjecture and the sum of digits of polynomial values. Proc. Am. Math. Soc. 139(1), 39–49 (2011)MathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    K. Hare, S. Laishram, T. Stoll, The sum of digits of n and n 2. Int. J. Number Theory 7(7), 1737–1752 (2011)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    F. Luca, The diophantine equation x 2 = p a ± p b + 1. Acta. Arith. 112, 87–101 (2004)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    C. Mauduit, J. Rivat, La somme des chiffres des carrés. Acta Math. 203(1), 107–148 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  17. 17.
    C. Mauduit, J. Rivat, Sur un problème de Gelfond: la somme des chiffres des nombres premiers. Ann. Math. (2) 171(3), 1591–1646 (2010)Google Scholar
  18. 18.
    A. Pethő, B.M.M. de Weger, Products of prime powers in binary recurrence sequences. I. The hyperbolic case, with an application to the generalized Ramanujan-Nagell equation. Math. Comput. 47(176), 713–727 (1986)Google Scholar
  19. 19.
    K. Stolarsky, The binary digits of a power. Proc. Am. Math. Soc. 71, 1–5 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  20. 20.
    L. Szalay, The equations 2n ± 2m ± 2l = z 2. Indag. Math. (N.S.) 13, 131–142 (2002)Google Scholar
  21. 21.
    B.M.M. de Weger, Algorithms for Diophantine Equations. CWI-Tract No. 65 (Centre for Mathematics and Computer Science, Amsterdam, 1989)Google Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Department of MathematicsUniversity of British ColumbiaVancouverCanada
  2. 2.Institute of Analysis and Number TheoryGraz University of TechnologyGrazAustria

Personalised recommendations