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 ======================