Loading [MathJax]/jax/output/SVG/jax.js
Research article

A complete comparison for the number of palindromes in different bases

  • Received: 07 November 2022 Revised: 05 February 2023 Accepted: 12 February 2023 Published: 23 February 2023
  • MSC : 11A63, 11A25, 11B75

  • Let b and b1 be distinct positive integers larger than 1, and let Ab(n) and Ab1(n) be the number of palindromes in bases b and b1 that are less than or equal to n, respectively. In this article, we finish the comparative study of the functions Ab(n) and Ab1(n). As a result, we present the full picture of the asymptotic behavior of their difference.

    Citation: Phakhinkon Napp Phunphayap, Prapanpong Pongsriiam. A complete comparison for the number of palindromes in different bases[J]. AIMS Mathematics, 2023, 8(4): 9924-9932. doi: 10.3934/math.2023502

    Related Papers:

    [1] Phakhinkon Phunphayap, Prapanpong Pongsriiam . Extremal orders and races between palindromes in different bases. AIMS Mathematics, 2022, 7(2): 2237-2254. doi: 10.3934/math.2022127
    [2] Hannah Blasiyus, D. K. Sheena Christy . Two-dimensional array grammars in palindromic languages. AIMS Mathematics, 2024, 9(7): 17305-17318. doi: 10.3934/math.2024841
    [3] Jiao Xu, Yinlan Chen . On a class of inverse palindromic eigenvalue problem. AIMS Mathematics, 2021, 6(8): 7971-7983. doi: 10.3934/math.2021463
    [4] Pith Peishu Xie . Numerical computations for Operator axioms. AIMS Mathematics, 2021, 6(4): 4011-4024. doi: 10.3934/math.2021238
    [5] Naqash Sarfraz, Muhammad Bilal Riaz, Qasim Ali Malik . Some new characterizations of boundedness of commutators of p-adic maximal-type functions on p-adic Morrey spaces in terms of Lipschitz spaces. AIMS Mathematics, 2024, 9(7): 19756-19770. doi: 10.3934/math.2024964
    [6] Babar Sultan, Mehvish Sultan, Aziz Khan, Thabet Abdeljawad . Boundedness of an intrinsic square function on grand p-adic Herz-Morrey spaces. AIMS Mathematics, 2023, 8(11): 26484-26497. doi: 10.3934/math.20231352
    [7] Eleonora Amoroso, Giuseppina D'Aguì, Valeria Morabito . On a complete parametric Sturm-Liouville problem with sign changing coefficients. AIMS Mathematics, 2024, 9(3): 6499-6512. doi: 10.3934/math.2024316
    [8] Ling Zhu . Asymptotic expansion of a finite sum involving harmonic numbers. AIMS Mathematics, 2021, 6(3): 2756-2763. doi: 10.3934/math.2021168
    [9] Mayurachat Janthawee, Narakorn R. Kanasri . On the SEL Egyptian fraction expansion for real numbers. AIMS Mathematics, 2022, 7(8): 15094-15106. doi: 10.3934/math.2022827
    [10] Swathi Shetty, B. R. Rakshith, N. V. Sayinath Udupa . Extremal graphs and bounds for general Gutman index. AIMS Mathematics, 2024, 9(11): 30454-30471. doi: 10.3934/math.20241470
  • Let b and b1 be distinct positive integers larger than 1, and let Ab(n) and Ab1(n) be the number of palindromes in bases b and b1 that are less than or equal to n, respectively. In this article, we finish the comparative study of the functions Ab(n) and Ab1(n). As a result, we present the full picture of the asymptotic behavior of their difference.



    Let b2 and n1 be integers. We call n a palindrome in base b (or b-adic palindrome) if the b-adic expansion of n=(akak1a0)b with ak0 has the symmetric property aki=ai for 0ik. As usual, if we write a number without specifying the base, then it is always in base 10, and if we write n=(akak1a0)b, then it means that n=ki=0aibi, ak0, and 0ai<b for all i=0,1,,k. Throughout this article, we let Ab(n) be the number of b-adic palindromes not exceeding n.

    Previously, we [1] obtained an extremal order of Ab(n) and proved that if b>b12 are integers, then

    lim supn(Ab(n)Ab1(n))=+  and  lim infn(Ab(n)Ab1(n))<0.

    In addition, if logblogb1 is irrational, then

    lim infn(Ab(n)Ab1(n))=. (1.1)

    Therefore, it is interesting to determine the value of the left-hand side of (1.1) when b is a rational power of b1. In this article, we show in Theorem 3.1 that if logb/logb1 is an integer, then the left-hand side of (1.1) is 1, and we obtain in Theorem 3.2 that if logb/logb1 is rational but not integral, then the left-hand side of (1.1) is . We also propose some possible research problems at the end of this article. We remark that the study on the ratio Ab(n)/Ab1(n) may be interesting too, but we were previously interested in the sign changes of Ab(n)Ab1(n), and so we focus only on the difference not the ratio. Nevertheless, since Ab(n)Ab1(n) has an infinite number of sign changes, if the limit of Ab(n)/Ab1(n) as n exists, then it must be one.

    Perhaps, one of the popular problems in palindromes is to determine whether or not there are infinitely many palindromic primes. Although this problem is still open, Banks, Hart and Sakata [2] showed that almost all palindromes in any fixed base b2 are composite. Banks and Shparlinski [3] also obtained results on prime divisors of palindromes, and there are many other interesting articles on palindromes too. We refer the reader to Banks [4], Cilleruelo, Luca and Baxter [5], and Rajasekaran, Shallit and Smith [6] for additive properties of palindromes, Bašić [7,8], Di Scala and Sombra [9], Goins [10], Luca and Togbé [11] for the study of palindromes in different bases, Cilleruelo, Luca and Tesoro [12] for palindromes in linear recurrence sequences, Harminc and Soták [13] for b-adic palindromes in arithmetic progressions, and Pongsriiam [14] for the longest arithmetic progressions of palindromes.

    In this section, we provide some results which are needed in the proof of the main theorems. Recall that for a real number x, x is the largest integer less than or equal to x, x is the smallest integer greater than or equal to x, and {x} is the fractional part of x given by {x}=xx. It is also convenient to define Cb(n) as follows.

    Definition 2.1. Let b2 and n=(akak1a1a0)b be positive integers. We define Cb(n)=(ckck1c1c0)b to be the b-adic palindrome satisfying ci=ai for kk/2ik. In other words, Cb(n) is the b-adic palindrome having k+1 digits whose first half digits are the same as those of n in its b-adic expansion, that is, Cb(n)=(akak1akk2ak1ak)b.

    In the following lemma, if P is a mathematical statement, then the Iverson notation [P] is defined by [P]=1 if P holds, and [P]=0 otherwise. Then the formula for Ab(n) is as follows.

    Lemma 2.1. [15] Let b2, n1, and n=(akak1a1a0)b be integers. Then the number of b-adic palindromes less than or equal to n is given by

    Ab(n)=bk2+0ik2akibk2i+[nCb(n)]2.

    Lemma 2.2. Let a,r,s2 be integers and (r,s)=1. If ars is an integer, then there exists an integer c2 such that a=cs.

    Proof. Suppose ars=m is an integer. Then ar=ms, and so a and m have the same set of prime divisors. Let a=ki=1paii and m=ki=1pmii. Then air=mis for all i. Since sair and (s,r)=1, sai for all i. Let c=ki=1pai/si. Then c is an integer, c2, and a=cs. So the proof is complete.

    Theorem 3.1. Let b>b12 and 2 be integers. Suppose that b=b1. Then, the following statements hold.

    (i) Ab(n)Ab1(n)1 for all nN.

    (ii) Ab(n)Ab1(n)=1 for infinitely many nN.

    (iii) lim infn(Ab(n)Ab1(n))=1.

    Proof. We first prove (i). Let n1 and write

    n=(akak1a0)b1=(crcr1c0)b.

    Since brcrbrn<br+1, we see that r=lognlogb. Similarly, we have k=lognlogb1, and so r=k/. By the uniqueness of the b-adic and b1-adic representations, we can write c0, c1, c2,, cr in terms of b1 and the aj as follows:

    Considering n modulo b, we obtain

    c0a0+a1b1+a2b21++a1b11(modb),

    and both sides of the congruence are nonnegative integers less than b, and so they are equal. Similarly, after reducing n modulo b2,b3,,br+1, respectively, we obtain c1,c2,cr. Thus

    cj=1i=0aj+ibi1  for every j=0,1,2,,r,

    where am=0 if m>k. By Lemma 2.1, we have

    Ab1(n)=bk21+0ik2akibk2i1+[nCb1(n)]2, (3.1)
    Ab(n)=br2+0jr2crjbr2j+[nCb(n)]2=bk21+0jk2(1i=0a(rj)+ibi1)b(k2j)1+[nCb(n)]2. (3.2)

    It is useful to recall that if kZ and xR, then k+x=k+x, and if kN and xR, then xk=xk. We also let s=kmod be the least nonnegative residue of k modulo , that is, ks(mod) and 0s<. Then, from (3.1) and (3.2), we obtain

    Ab1(n)={bk21+0ik2akibk2i1+[nCb1(n)]2,if k is even;bk+121+0ik12akibk12i1+[nCb1(n)]2,if k is odd,  (3.3)
    Ab(n)={bks21+0jks21i=0aksj+ibks2j+i1+[nCb(n)]2,if k is even;bks+21+0jks21i=0aksj+ibks2j+i1+[nCb(n)]2,if k is odd. (3.4)

    Next, we will reduce the double sum in (3.4) into a sum. We see that if k is even, then j+i runs through the integers from ks2 to 1 exactly once as j runs through 0,1,2,,ks2 and i runs through 0 to 1. Similarly, if k is odd, then j+i ranges over the integers from ks2 to 1 exactly once as j ranges over 0,1,2,,ks2 and i ranges over 0 to 1. So if k is even, the first double sum in (3.4) reduces to

    ks2i1aks+ibks2+i1.

    We replace the index i by iks2 and recall that s1, aks2+i=0 if i>k+s2, and 1+ks2k+s2. So the first double sum in (3.4) further reduces to

    0ik+s2aks2+ibi1.

    Similarly, if k is odd, then the second double sum in (3.4) reduces to

    ks2i1aks+ibks2+i1=0ik+s2aks+2+ibi1.

    From (3.4) and the above calculation, we obtain

    Ab(n)={bks21+0ik+s2aks2+ibi1+[nCb(n)]2,if k is even;bks+21+0ik+s2aks+2+ibi1+[nCb(n)]2,if k is odd. (3.5)

    Next, we divide the proof into four cases according to the parity of k and k.

    Case 1. Assume that k and k are even. Then, s is even and

    0ik+s2aks2+ibi1bs21s2ik+s2aks2+ibis21=bs210ik2akibk2i1.

    By (3.3), (3.5) and the above inequality, we obtain that Ab(n)Ab1(n) is at least

    bks21bk21+(bs211)0ik2akibk2i11bks21bk21+akbk21(bs211)1=bk21(akbs21+bs21ak1)1.

    Since the function xakx+x1 is increasing on [1,), the number in the above parenthesis is nonnegative, and so Ab(n)Ab1(n)1.

    Case 2. Assume that k is odd and k is even. Then s is odd. Similar to Case 1, we obtain

    0ik+s2aks2+ibi1bs+121s+12ik+s2aks2+ibis+121bs+1210ik12akibk12i1.

    By (3.3), (3.5) and the above inequality, we see that Ab(n)Ab1(n) is at least

    bks21bk+121+akbk121(bs+1211)1=bk21(akbs21+bs21akb121b121)1.

    Since xakx+x1 is increasing on [1,) and bs21b1211, we have akbs21+bs21akb121+b121, and

    Ab(n)Ab1(n)bk21(akb121+b121akb121b121)1=bk21(ak1)(b121b121)11.

    Case 3. Assume that k is even and k is odd. Then kss(mod2). So s2 is an integer and s2>0. So s21. Considering the first sum in (3.3) and changing the index from i to k+s2i, we see that

    0ik2akibk2i1=s2ik+s2aks+2+ibi+s21=bs210ik+s2aks+2+ibi1+s2i<0aks+2+ibi+s21=bs210ik+s2aks+2+ibi1+0i<s2ak2+ibi1bs210ik+s2aks+2+ibi1+(bs211).

    By (3.3), (3.5) and the above inequality, we obtain

    Ab(n)Ab1(n)bks+21bk21+(1bs21)0ik+s2aks+2+ibi1(bs211)1. (3.6)

    The sum on the right-hand side of (3.6) is less than or equal to bk+s2+111 and 1bs21 is negative. Therefore, Ab(n)Ab1(n) is at least

    bks+21bk21+(1bs21)(bk+s2+111)+(1bs21)1=bk21(bs21+b1s21b11)1.

    Since the function xbx1+b1x1 is increasing on [1,) and s21, the number in the above parenthesis is nonnegative, and so Ab(n)Ab1(n)1.

    Case 4. Assume that k and k are odd. Changing the index from i to k12s12i, the second sum in (3.3) is

    0ik12akibk12i1=s12ik+s2aks+2+ibi+s121=bs1210ik+s2aks+2+ibi1+s12i<0aks+2+ibi+s121bs1210ik+s2aks+2+ibi1+(bs1211).

    By (3.3), (3.5) and the above inequality, we obtain that Ab(n)Ab1(n) is at least

    bks+21bk+121+(1bs121)0ik+s2aks+2+ibi1(bs1211)1bks+21bk+121+(1bs121)(bk+s2+111)+(1bs121)1=bk+121(bs121+bs1212)1.

    Since x+x12 for all x>0, we see that Ab(n)Ab1(n)1.

    In any case, we obtain Ab(n)Ab1(n)1, as desired. This proves (i).

    Next, we prove (ii). For each kN, let n=nk=b2k11+1. Then n=b11b2k1+1. By Lemma 2.1, we obtain

    Ab1(n)=b2k121+b2k1211=bk1+bk111,
    Ab(n)=b2k12+b11b2k122=bk+b11bk12=bk1+bk112.

    Therefore Ab(n)Ab1(n)=1. Since n=nk and k is arbitrary, this shows that there are infinitely many nN such that Ab(n)Ab1(n)=1. This proves (ii). Then (iii) follows immediately from (i) and (ii). So the proof is complete.

    Since we have already got the answers to the cases when logb/logb1 is irrational and when it is integral, it remains to consider the case when logb/logb1 is a rational number and is not an integer.

    Theorem 3.2. Let b>b12 be integers and b=brs1 where r,sN, r>s>1, and (r,s)=1. Then

    lim infn(Ab(n)Ab1(n))=.

    Proof. To prove this theorem, it is enough to find a sequence (nk)k1 of positive integers such that nk+ and Ab1(nk)Ab(nk)+ as k+. We divide the calculation into three cases according to parity of r and s, and adjust the exponents so that Ab1(n) is large and Ab(n) is small.

    Case 1. Assume that s is even. Let k be a positive integer and n=nk=bs(2k+1)+1. Since (r,s)=1, s is even, and br1=bs, we see that r is odd and n=br(2k+1)1+1. By Lemma 2.1, we obtain Ab(n)=2bsk+s21 and

    Ab1(n)=br(2k+1)21+br(2k+1)211=bkr+r+121+bkr+r1211=b121bsk+s2+b121bsk+s21.

    Since x+x1>2 for all x>1, we see that b121+b1212 is a positive constant. Therefore,

    Ab1(n)Ab(n)=bsk+s2(b121+b1212)+  as  k+.

    Case 2. Assume that s and r are odd. Since brs1=b is an integer, we obtain by Lemma 2.2 an integer b22 such that b1=bs2, and so b=br2. Since (2s,r)=1, there exists a negative integer x such that 2sx1(modr). Since the proof of Case 1 is finished, we will define a new sequence (nk)k1 using the same notation. Let k be a positive integer and let n=nk=b2x(1s)+2rk+11+1. For convenience, let =x(1s)+rk. So N, 5, and n=b2+11+1. By Lemma 2.1 and the fact that b1=bs2, we obtain

    Ab1(n)=b+11+b11=bs+s2+bs21. (3.7)

    Next, let y=s(2+1)1r. By the definition of and x, we have

    s(2+1)=2sx(1s)+2srk+s1(modr).

    Therefore y is a positive integer. Since s(2+1)1 is even and r is odd, we see that y is even. To calculate Ab(n), we write

    n=b2+11+1=bs(2+1)2+1=bry+12+1=b2by+1.

    So b2 is the leading digit in the b-adic representation of n. Since y is even and b=br2, we obtain by Lemma 2.1 that

    Ab(n)=bry22(1+b2)2=bs+s122(1+b2)2. (3.8)

    From (3.7) and (3.8), we obtain

    Ab1(n)Ab(n)=bs+s22B+1,  where  B=bs22+bs22b122b122.

    Since the function xx+x1 is strictly increasing on (1,) and bs22>b122>1, we see that B is a positive constant. Therefore, Ab1(n)Ab(n)=bs+s22B+1+ as +. Since =x(1s)+rkk, we see that Ab1(n)Ab(n)+ as k+. So the proof of Case 2 is complete.

    Case 3. Assume that s is odd and r is even. This case is similar to Case 2 and we only need to modify some calculations. Again, we have b1=bs2 and b=br2 for some integer b22. Since (2r,2s)=2 and 21s, there exists a positive integer k such that

    2sk1s(mod2r). (3.9)

    In fact, there are infinitely many positive integers k satisfying (3.9), so we can choose k to be arbitrarily large. Let n=nk=b2k+11+1. By Lemma 2.1 and the fact that b1=bs2, we obtain

    Ab1(n)=bk+11+bk11=bsk+s2+bsk21. (3.10)

    Next, let y=s(2k+1)1r. By (3.9), we have s(2k+1)=2sk+s1(mod2r). Therefore 2r divides s(2k+1)1, and thus y=2(s(2k+1)12r) is an even positive integer. To calculate Ab(n), we write

    n=b2k+11+1=bs(2k+1)2+1=bry+12+1=b2by+1.

    By Lemma 2.1, we obtain

    Ab(n)=bry22(1+b2)2=bks+s122(1+b2)2. (3.11)

    From (3.10), (3.11) and a similar reason as in Case 2, we obtain

    Ab1(n)Ab(n)=bks+s22(bs22+bs22b122b122)+1+  as  k+.

    This completes the proof.

    Let us record all related results that we obtained as follows.

    Summary of the results:

    Let b>b12 be integers. Then, the following statements hold.

    (i) If logblogb1 is not an integer, then,

    lim supn(Ab(n)Ab1(n))=+  and  lim infn(Ab(n)Ab1(n))=.

    (ii) If logblogb1 is an integer, then,

    lim supn(Ab(n)Ab1(n))=+  and  lim infn(Ab(n)Ab1(n))=1.

    (iii) Ab(n)Ab1(n) has an infinite number of sign changes as n.

    (iv) If sb and sb1 are the sums of the reciprocal of palindromes in bases b and b1, respectively, then sb and sb1 are finite and sb>sb1.

    The statements (i)–(iii) come directly from [1, Theorems 11 and 12], and Theorems 3.1 and 3.2 of this article. The finiteness of sb and sb1 in (iv) is given by Shallit and Klauser [16] and the inequality sb>sb1 is obtained from [17, Theorem 3].

    Now that for all cases we have obtained results for the comparison between the number of palindromes in two bases, it is natural to extend this to more than two bases. So let k2 and b1>b2>>bk2 be integers. Let c1,c2,,ck be any permutation of b1,b2,,bk.

    Question 4.1. Does the inequality Ac1(n)<Ac2(n)<<Ack(n) hold for infinitely many nN? We conjecture that if logbi/logbj is irrational for every distinct i,j=1,2,,k, then the inequality holds for infinitely many nN. What are the answers when one of the following situations occur?

    (i) logbilogbi+1 is integral for every i=1,2,,k1;

    (ii) logbilogbj is rational but not integral for each distinct i, j;

    (iii) The set {logbilogbj | 1i<jk} contains both an irrational number and a rational number.

    Prapanpong Pongsriiam's research project is funded jointly by the Faculty of Science Silpakorn University and the National Research Council of Thailand (NRCT), grant number NRCT5-RSA63021-02. He is also supported by the Tosio Kato Fellowship given by the Mathematical Society of Japan during his visit at Nagoya University in July 2022 to July 2023.

    The authors declare no conflicts of interest regarding the publication of this article.\newpage



    [1] P. Phunphayap, P. Pongsriiam, Extremal orders and races between palindromes in different bases, AIMS Math., 7 (2022), 2237–2254. https://doi.org/10.3934/math.2022127 doi: 10.3934/math.2022127
    [2] W. D. Banks, D. N. Hart, M. Sakata, Almost all palindromes are composite, Math. Res. Lett., 11 (2004), 853–868. https://doi.org/10.4310/MRL.2004.v11.n6.a10 doi: 10.4310/MRL.2004.v11.n6.a10
    [3] W. D. Banks, I. E. Shparlinski, Prime divisors of palindromes, Period. Math. Hung., 51 (2005), 1–10. https://doi.org/10.1007/s10998-005-0016-6 doi: 10.1007/s10998-005-0016-6
    [4] W. D. Banks, Every natural number is the sum of forty-nine palindromes, Integers, 16 (2016), 1–9.
    [5] J. Cilleruelo, F. Luca, L. Baxter, Every positive integer is a sum of three palindromes, Math. Comput., 87 (2018), 3023–3055. https://doi.org/10.1090/mcom/3221 doi: 10.1090/mcom/3221
    [6] A. Rajasekaran, J. Shallit, T. Smith, Sums of palindromes: an approach via automata, In: 35th symposium on theoretical aspects of computer science (STACS 2018), 54: 1–54: 12. https://doi.org/10.4230/LIPIcs.STACS.2018.54
    [7] B. Bašić, On d-digit palindromes in different bases: the number of bases is unbounded, Int. J. Number Theory, 8 (2012), 1387–1390. https://doi.org/10.1142/S1793042112500819 doi: 10.1142/S1793042112500819
    [8] B. Bašić, On " very palindromic" sequences, J. Korean Math. Soc., 52 (2015), 765–780. https://doi.org/10.4134/jkms.2015.52.4.765 doi: 10.4134/jkms.2015.52.4.765
    [9] A. J. Di Scala, M. Sombra, Intrinsic palindromes, Fibonacci Quart., 42 (2004), 76–81.
    [10] E. H. Goins, Palindromes in different bases: a conjecture of J. Ernest Wilkins, Integers, 9 (2009), 725–734. https://doi.org/10.1515/INTEG.2009.059 doi: 10.1515/INTEG.2009.059
    [11] F. Luca, A. Togbé, On binary palindromes of the form 10n±1, C. R. Math., 346 (2008), 487–489. https://doi.org/10.1016/j.crma.2008.03.015 doi: 10.1016/j.crma.2008.03.015
    [12] J. Cilleruelo, R. Tesoro, F. Luca, Palindromes in linear recurrence sequences, Monatsh. Math., 171 (2013), 433–442. https://doi.org/10.1007/s00605-013-0477-2 doi: 10.1007/s00605-013-0477-2
    [13] M. Harminc, R. Soták, Palindromic numbers in arithmetic progressions, Fibonacci Quart., 36 (1998), 259–261.
    [14] P. Pongsriiam, Longest arithmetic progressions of palindromes, J. Number Theory, 222 (2021), 362–375. https://doi.org/10.1016/j.jnt.2020.10.018 doi: 10.1016/j.jnt.2020.10.018
    [15] P. Pongsriiam, K. Subwattanachai, Exact formulas for the number of palindromes up to a given positive integer, Int. J. Math. Comput. Sci., 14 (2019), 27–46.
    [16] H. Klauser, J. Shallit, Sum of base-b palindrome reciprocals, Fibonacci Quart., 19 (1981), 469.
    [17] P. Phunphayap, P. Pongsriiam, Reciprocal sum of palindromes, J. Integer Seq., 22 (2019), 1–13.
  • Reader Comments
  • © 2023 the Author(s), licensee AIMS Press. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0)
通讯作者: 陈斌, bchen63@163.com
  • 1. 

    沈阳化工大学材料科学与工程学院 沈阳 110142

  1. 本站搜索
  2. 百度学术搜索
  3. 万方数据库搜索
  4. CNKI搜索

Metrics

Article views(1433) PDF downloads(58) Cited by(0)

/

DownLoad:  Full-Size Img  PowerPoint
Return
Return

Catalog