General Generating Function For Palindromic Products of Consecutive Integers

by

Huen Y.K.

CAHRC, P.O.Box 1003, Singapore 911101
http://web.singnet.com.sg/~huens/
email: huens@mbox3.singnet.com.sg

(A short communication - 18/2/98, revised: 18/2,revisions: 19/2, 24/2)

Abstract

This paper shows how to develop a general generating function for palindromic products of consecutive integers which is based the rather cryptic formula of base x (base+1). The generating function is computed using a program line written in Macsyma 2.2.1. With the development of sequence algebra since 1994, many difficult number sequences can now be predicted algebraically by mixed mode formulations. These formulations are most suitable for the development of algorithms to be programmed by symbolic packages.


1. Introduction

The acronym MMF is defined to stand for mixed mode filter. In sequence algebra, number sequences can be predicted either by closed or open formulations. MMFs are generally associated with open formulations which are computationally more efficient than the closed forms. One of the earliest applications of a mixed mode filter (hereafter referred to by its acronym of MMF) was in the development of the sequence algebraic generating function of the prime sequence Prime(z) where a finite expansion in Laurent series form is given by equation (1) [1,3 to 6]. Note that both the program lines are based on open formulations with embedded filters.

Macsyma:Prime_z:sum(1/z^i*(primep(i)-false)/(true-false),i,2,20);
Maple:Prime(z):=sum(1/z^i*(isprime(i)-false)/(true-false),i=2..20);

.......................................1.......1.........1........1.......1........1.......1......1
...................Prime(z) := ---- + ---- + ---- + ---- + --- + --- + --- + --- ...............(1).
.........................................2.......3.........5.........7......11.....13.....17.....19
.......................................z.......z..........z.........z.......z.........z.......z.......z

The MMF used is either (primep(i)-false)/(true-false) or (isprime(i)-false)/(true-false) which looks straightforward enough but it is easy for one to overlook the intricacies of using mixed mode operations, i.e., the mixing of boolean logic with arithmetic operations. In classical mathematics, such mixing would be frowned upon because the presence of mixed mode operators often impedes continuous algebraic analyses. This purist viewpoint is not so popular with computer scientists or programmers who are more interested to develop viable algorithms in the shortest possible time. The reason for using MMFs is justifiable when it is impossible to develop equivalent formulations using conventional arithmetics and algebra. Mixed mode algorithms have already been used by programmers for decades and thus do not represent anything new. The only contribution from sequence algebra is that global formulations could be written down compactly using appropriate MMFs. An arithemtical relation involving logical levels such as (true-false) is definitely meaningless and yet one could exploit those relations which return numerical values of either 0 or 1 such as (false-false) = 0 and (true-false)/(true-false) = 1. We can therefore use 0s to suppress the displays of terms and 1s to turn on the displays. This is why we call such expressions filters. In the next section, we will demonstrate the expressive power of MMFs. Even though one could write down rapidly formulations for some difficult number theoretic sequences, one must be aware that there are algebraic limitations in MMFs. As mentioned before, one of the limitations is that the presence of an MMF would impede continuous algebraic analyses.

2. Palindromes

A palindrome is a multidigit natural number which reads the same numerically in both directions, e.g., 1234321 is a palindrome. A specific type of palindromes are generated by taking the consecutive products of two consective integers and are defined by the mnemonic formula: base x (base + 1). In sequence algebra this formula is translated into F(i) = i^k+(i+1)^k+(i+2)^k + ... where i is the base and the power index k can vary from 1 to a large upperbound. Here are some samples of palindromes obtained by taking two consecutive integers:

16 x 17 = 272
The above product is also called Palindromic Pronic Numbers".
16+17 = 33
16^2+17^2=545
16^3+17^3=9009

Some palindromes can be obtained by taking three consective integers as follows:

16^3+17^3+18^3 = 14841
1736^2+1737^2+1738^2=9051509

For more information on classifications of palindromes and current records please visit:

  • Patrick De Geest's Homepage On Palindromes
    Testing a number for its palindromacy is best handled as a string since reversing a string is easily done in symbolic algebraic packages but reversing a number is not. When one string is divided by another string, only when the two strings are identical will the quotient be unity. We therefore design an MMF for testing the occurrences of unities by an Oddp function which will return true if any quotient is unity and false otherwise.

    The general formulation will take the form shown in equation (2a). The input expression %1 for the sum of squares of consecutive integer is given by equation (2b) [2]. You can change to expression to suit the computations such as raising the power index above 2 or taking on three consecutive integers. You can also increase the intervals between successive integers to be greater than unity.

    i=n2
    -----/........................string(%1)..............................\
    .\.....|oddp(---------------------------------) - false.|
    ..\.....\............string_reverse(string(%1))................../
    ...\....-------------------------------------------------...............................(2a).
    .../
    ../.....................................................%1
    ./...............................(true - false) z
    ------
    i=n1

    ..............................................2...........2
    %1 :=.................................(i + (i + 1) ).....................(2b).

    The Macsyma program line given by equation (2c) will generate the palindromic sequence within a specified range of i = lowerbound to upperbound. A general term in the sequence will take the form:

    ...........................i/z^(i^2+(i+1)^2) .............................................(2c).

    so that the numerator coefficient i will give the base term and the power index to z will give the palindromnic number. This formula is handy because we can alter the input expression %1 via equation (2b) and the range of computations by i.

    The string_reverse function has to be separately written as given by equation (2d).

    string_reverse(s):=(if not stringp(s) then error("The argument to STRING_REVERSE must be a string: ",s), block([s2:"", len:string_length(s)], for i thru len do s2: concat(getchar(s,i),s2),return(s2)))$ .................(2d).

    Solutions:

    s:string(12345567);
    .................................1234567

    string_reverse(s);
    .................................7654321




    Example 1: Palindromic Products of Two Consecutive Integers

    sum((oddp(string(i^2+(i+1)^2)/(string_reverse(string(i^2+(i+1)^2))))-false)/(true-false) *i/z^(i^2+(i+1)^2),i,0,10000);..........(2c).

    The palindromic sequence generated is shown in equation (2d).

    ..1........9........12.....16.......919
    ---- + ---- + ---- + ---- + --------
    .....5.....181....313....545....1690961
    ...z.......z........z.........z........z

    1257............1262............1621.............1706
    -----------+----------+-----------+------------........................................(2d).
    ..3162613.....3187813......5258525......5824285
    z..................z..................z..................z

    From (2e) to (2f), samples of sums of two consecutive integers from cubic power to the 7th power are computed.

    sum((oddp(string(i^3+(i+1)^3)/(string_reverse(string(i^3+(i+1)^3))))-false)/(true-false) *i/z^(i^3+(i+1)^3),i,0,10000);..........(2c).

    (1/(z^9)) + (16/(z^9009)).....................................(2e).

    sum((oddp(string(i^4+(i+1)^4)/(string_reverse(string(i^4+(i+1)^4))))-false)/(true-false) *i/z^(i^4+(i+1)^4),i,0,10000);..........(2c).

    (9/(z^16561))....................................................(2f).

    sum((oddp(string(i^5+(i+1)^5)/(string_reverse(string(i^5+(i+1)^5))))-false)/(true-false) *i/z^(i^5+(i+1)^5),i,0,200);..........(2c).

    (1/(z^33)) + (5/(z^10901)).................................(2g).

    sum((oddp(string(i^6+(i+1)^6)/(string_reverse(string(i^6+(i+1)^6))))-false)/(true-false) *i/z^(i^6+(i+1)^6),i,0,200);..........(2c).

    0.....................................................................(2h).

    sum((oddp(string(i^7+(i+1)^7)/(string_reverse(string(i^7+(i+1)^7))))-false)/(true-false) *i/z^(i^7+(i+1)^7),i,0,200);..........(2c).

    0.....................................................................(2i).

    Comments: The only limits to multidigit computations in symbolic softwares are memory and time resources. However, a Pentium Pro would be hard pressed if used in exhaustive search not unless one is luckly in a random scan. However only a systematic and exhaustive scan can reveal fundamental properties. For example in the above truncated computations, it seems to suggest that palindromes will become exceedingly rare if the power index is raised above 6.




    Example 2: The sums of the cubes of consecutive integers are also tested using the same program line but with the input expressions modified accordingly.

    sum((oddp(string(i^3+(i+1)^3+(i+2)^3)/(string_reverse(string(i^3+(i+1)^3+(i+2)^3))))-false)/(true-false) *i/z^(i^3+(i+1)^3+(i+2)^3),i,0,1000);..........(2c).

    (2/(z^99)) + (16/(z^14841)) ..........................................................(3a).

    sum((oddp(string(i^3+(i+1)^3+(i+2)^3+(i+3)^3)/(string_reverse(string(i^3+(i+1)^3+(i+2)^3+(i+3)^3))))-false)/(true-false) *i/z^(i^3+(i+1)^3+(i+2)^3+(i+3)^3),i,0,1000);..........(2c).

    (59/(z^886688))...........................................................................(3b).

    sum((oddp(string(i^4+(i+1)^4+(i+2)^4+(i+3)^4)/(string_reverse(string(i^4+(i+1)^4+(i+2)^4+(i+3)^4))))-false)/(true-false) *i/z^(i^4+(i+1)^4+(i+2)^4+(i+3)^4),i,0,1000);..........(2c).

    ...................................0.............................................................(3c).

    Comments: The numerical scans are brief as the objective is to develop and test the general algebraic generating function for this type of sequences as given by equations (2a,b). Currently one should be able to search with i up to 6000 decimal digits although it would take hours to check a single number. Aided by a touch of luck, the formulations could be used by those with the necessary hardware resources and plenty of patience to hunt for recording breaking palindromes.




    3. Conclusions

    This paper shows how to develop the algebraic generating function for the palindromic sequence of sums of consecutive integers. No attempts are made to perform exhaustive scans for palindromes. The use of MMFs in sequence algebraic formulations have scored repeated successes in the past. One unique advantage of such formulations is that one could write down the program line direct from the algebraic expression. This you cannot do if you use a compiled language software. One disadvantage for the time being is that symbolic softwares still run at least an order slower than compiled softwares. This situation is sure to change in the near future with PCs rapidly acquring the computing power of workstations. The days of doing algebra using only pencil and paper are over. Superhumanity will emerge as the symbiosis between the brain and man-made technology. The symbiosis between algebra and computers has already started and will become increasingly integrated in future.

    4 Acknowledgements

    The author wishes to thank Dr. J.P.Golden of Macsyma Inc., who contributed the string_reverse function which has greatly shortened the program lines used in this paper.

    5 References

    1. Sequence Algebra - A Tutorial Paper - Huen Y.K. (Date Released 2/2/98, 46 Kbytes)

    ================================================
    2. Macsyma: Symbolic/numeric/graphical mathematics software, Mathematics and System Reference Manual, 16th edition, relevant sections.

    Published Papers:

    3. Huen Y.K.: A Matrix Map for Prime and Non-prime Numbers, INT. J. Math. Educ. Sci. Technol., 1994, VOL. 25, NO.6, pp 913-920.

    4. Huen Y.K.: Some Interesing Properties Of The Natural Number System, Int. J. Math. Educ. Sci. Technol., 1996, VOL.27, NO. 5, 685-691.

    5. Huen Y.K.: Visual algebra and its applications, INT. J. Math. Educ. Sci. Technol., 1997, VOL.28, NO.3, pp 333-344.

    6. Huen Y.K.: The twin prime problem revisited, INT. J. Math. Educ. Sci. Technol.,1997, VOL.28, NO. 6, pp 825-834.

    7. Huen Y.K.: Is Pie Periodic?, INT. J. Math. Educ. Sci. Technol.,199?,VOL.??,NO.?,???-???. (in the press).

    8. Huen Y.K.: Final value theorem in number sequences., INT. J. Math. Educ. Sci. Technol.,199?,VOL.-??,NO.?,???-???. (accepted).

    Papers posted in this website.

    Comments: References from this point onward are not referred in the main paper. Most are provided for readers not familiar with sequence algebra. These papers can be easily hyperlinked whilst you surf into this URLsite.

    9. A Simple Introduction To Sequence Algebra - by Huen Y.K. (date release: 15.3.97) (38 KBytes, 11*A4 pages).

    ========================================================

    10. Evaluations Of Normc( ) Function In Macsyma 2.2 - Huen Y.K. (Date Released 17/12/97, 14 Kbytes)

    ================================================

    11. List Processing In Sequence Algebra - Huen Y.K. (Date Released 23/12/97, 20 Kbytes)

    ================================================

    12. The Canonical Generating Function or CGF(z) ... - by Huen Y.K. (date released : 27.5..97) (24 KBytes, 7*A4s).

    ========================================================

    13. Visual Solutions Of Number Theoretic Problems ..... - by Huen Y.K. (date released : 3.6.97) (38.3 KBytes, 10*A4s).

    ========================================================

    14. Final Value Theorem Applied To Number Sequences... - by Huen Y.K. (date released : 5.6.97) (29.4 KBytes, 9*A4s).

    ========================================================

    15. Methods Of Developing Sequence Algebraic Formulations For Comp(z) and Prime(z) - by Huen Y.K. (date released : 20.6.97) (36.8 KBytes, 10*A4s).

    ========================================================

    16. Composite Number Sequence Challenge 1/97 - by Huen Y.K. (date released : 28.6.97) (24.8 KBytes, 7*A4s).

    ========================================================

    17. Lemmata, Corollaries, And Theorems In Sequence Order Analysis. - by Huen Y.K. (date released : 6.7.97) (38.3 KBytes, 12*A4s).

    ========================================================

    18. Improved Formulations For Comp(z) and Prime(z) - by Huen Y.K. (date released : 16.9.97) (17 KBytes ).

    ========================================================

    19. Detecting False Reports in Primality Tests By The Oddcomp(z) Method. - by Huen Y.K. (date released : 18.9.97, Revised 20/9) (26 KBytes ).

    ========================================================

    20. The Throwing Power Of Oddcomp(z). - by Huen Y.K. (date released : 24.9.97 ) (15 Kbytes).

    ========================================================

    21. Sequence Algebraic Approach To Prime Number Theorem - by Huen Y.K. (date released : 28.9.97 ) (21 Kbytes).

    ========================================================

    22. Generating Functions - Closed Forms vs Open Forms - by Huen Y.K. (date released : 1.10.97 ) (21 Kbytes).

    ========================================================

    23. Generating Large Odd Composite With Two Prime Factors - by Huen Y.K. (date released : 3.10.97 ) (13.5 Kbytes).

    ========================================================

    24. In Search Of Counter- Examples In Maple's Isprime Function. - by Huen Y.K. (date released : 4.10.97 ) (18 Kbytes).

    ========================================================

    25. A Sequence Algebraist's View Of Lehmann's Primality Test - by Huen Y.K. (date released : 6.10.97 ) (26 Kbytes).

    ========================================================

    26. On Odd(z), Oddcomp(z), Seq1(z) and Seq2(z) - by Huen Y.K. (date released : 10.10.97 ) (17 Kbytes).

    ========================================================

    27. How To Generate A Short And Contiguous Oddcomp(z) Sequence? - by Huen Y.K. (date released : 15.10.97 ) (13 Kbytes).

    ========================================================

    28.The Manipulations Of Bilinear Sequences By Macsyma 2.2- by Huen Y.K. (date released : 5.2.98, 22 Kbytes).

    ========================================================
    =====================END OF PAPER ======================