Amateur Quest For Lychrel Numbers 311
Habberhead writes "Some people are aware of the quest for a palindromic solution for the number 196. Basically any number that doesn't form a palindrome by reversing and adding its digits is known as a Lychrel Number. (Sequence Number A023108 of Sloan's On-Line Encyclopedia of Integer Sequences) The number 196 happens to be the first of them. In over a year's worth of time, and more than 2 quadrillion calculations, this guy at www.p196.org has reversed and added the number over 100 MILLION times. His current answer is over 41 million digits long! Apparently he and a few others are also working on a distributed computing program for finding larger and larger Lychrel Numbers. It looks like they have in mind a Seti@Home style program with visible results."
what? (Score:1, Informative)
Re:what? (Score:5, Informative)
908 + 809 = 1717
1717 + 7171 = 8888, which is a palindrome.
However,
196 + 691 = 887
887 + 788 = 1675
1675 + 5761 = 7436
7436 + 6347 = 13783
and contining on for a few million digits still doesn't end up at a palindrome.
Re:what? (Score:1)
Now, can you explain why anyone would spend time doing this? :)
Re:what? (Score:1)
Re:what? (Score:3, Funny)
256 + 652 is not 908 but 808.
Re:what? (Score:2)
Re:what? (Score:2)
Re:what? (Score:2)
It kills me that your email is from physics.uc.edu..
Re:what? (Score:2)
Re:what? (Score:2)
palidrome vs number bases (Score:3, Interesting)
Of course this is only relevant depending on base ten numbers. You milage will vary depending on the base.
It is a quirk of numbers based on the nuances of the notation system you are using, and as such is amusing for some.
I imagine there may be more palidromes in a base two system, vs, say, a base 666 system. (to choose an arbitrary base).
Oddities of this sort of thing might have some usefulness in offbeat cryto systems, but beuyond that ...
Re:palidrome vs number bases (Score:2)
No. In any base, the number of palindromes less than n is O(n^(1/2)).
A Geek who gets off on numbers ... (Score:1)
His website is a great treasure chest of information for folks looking to do this in their spare time. He seems to be pretty level headed, but just gets off on this.
And the reason is...? (Score:1)
Confused...I am...
Simple Example (Score:5, Interesting)
196+691 = 887 (which is not a palindrome)
Apply the same for 887, 887+788 = 1675 (not a palindrome)
Apparently, you can go on forever like this without ever reaching a palindrome!
152, on the other hand, which I picked randomly, quickly reaches 707 which is a palindrome.
Personally, I don't find this interesting at all. I posted a story a week ago about the prime number problem being solved for the first time with a deterministic algorithm and it was rejected by /. OOPS! Did I just go offtopic? Sorry, mods!!!
Re:Simple Example (Score:3, Informative)
You aren't talking about this [slashdot.org] by any chance, are you?
Re:Simple Example (Score:2)
Re:Simple Example (Score:2)
who cares? (Score:2, Insightful)
stipe42
Re:who cares? (Score:1)
Who knows, maybe someone will think of an application for it. Base two wasn't particularly relevant before binary computers came about, stuff like that.
Re:who cares? (Score:2)
"Boole's system of logic is but one of many proofs of genius and patience combined." was how De Morgan commented. It is not recorded how many whiny teens said "so what".
It's first real practical use was for telephone switching.
Re:who cares? (Score:2)
Besides, much like this theory, boolean algebra was all but ignored by the mathematical community at large until the 1940s, when the introduction of computers made the field suddenly relevant.
In a nutshell.... (Score:2, Informative)
87+78 = 165
165+651 = 726
726+627 = 1353
1353+3531 = 4884, a palindrome!
This article is saying that for the thousands of numbers tested, every one except 196 has exhibited this property.
Re:In a nutshell.... (Score:5, Funny)
Try doing it with 691!
Re:In a nutshell.... (Score:2, Funny)
Re:In a nutshell.... (Score:4, Insightful)
This link [rr.com] comes from a link on the www.p196.org [p196.org] page.
Moderators: Please mod the parent poster down for dishonesty.
Thanks.
Re:In a nutshell.... (Score:2)
Re:In a nutshell.... (Score:2, Interesting)
#!/usr/bin/perl -w
use strict;
for(my $x=1; $x < 100; $x++) {
paltest($x, $x, 0);
} # End for
sub paltest {
my($number, $orig, $reclevel) = @_;
if($number eq reverse($number)) {
print "$orig yields a palindrome at recursion level $reclevel.\n";
return 1;
} else {
my $rev = reverse($number);
return paltest(($rev + $number), $orig, ($reclevel + 1));
} # End else
} # End paltest
OT: Stack Overflow in Perl (Score:2)
Would this, actually? If so, it's a shame. That's an obvious case for tail-recursion elimination. I guess perl doesn't demand this like scheme does?
Will parrot support the ability to do stack-based tail recursion elimination? I know that this has been one of the big pains of java-based scheme implementations: For security reasons, it's hard to mess with the stack in the apppropriate ways. Right? Cause that code needs only constant stack space, right?
It'd be a shame if this new technology everyone is investing so much in... OK, I meant parrot, that apparetnly perl 6 will be based on... Is not going to have hooks to support that type of optimization that doens't just improve coefficients, but takes you from O(n) to O(1)...
Re:In a nutshell.... (Score:2)
Wrong, 196 is though to be the smallest integer with this property. Check the integer sequence [att.com] referenced. It gives 45 integers which are thought to have this property, starting with 196, 295, 394, 493, 592, 689, 691,...
(I'd bet there are either infinitely many such numbers or none...)
Re:In a nutshell.... (Score:3, Insightful)
Actually, given a little thought, that's quite trivial to prove:
Suppose there is an integer N that doesn't become palindrome. Then every integer in its calculation sequence is also an integer that doesn't become palindrome. So either there are no such integers, or there are infinitely many. Duh!
But the question forms out whether there are infinitely many base numbers: I'd bet that there are either no Lychrel numbers, or there are infinitely many "base" Lychrel numbers.
Well, except for... (Score:2)
196 + 691 = 887
887 + 788 = 1675
Obviously, if 196 doesn't work, then 691 won't, and neither will 887, or 788, or 1675 etc
Or did the article mention that another condition for Lychrel numbers was that the number can't be part of another one's sequence?
Real world applications? (Score:4, Interesting)
Maybe some psuedo-random number generation with the huge strings of numbers that this comes up with?
Any way that this could be used in some sort of encryption?
There HAS to be some useful purpose to this.. There must be, or it wouldn't be the way it is! *twitch, twitch*
-Matt
How about compression (Score:1)
Re:Real world applications? (Score:2)
What else are unemployed trivia-loving geeks gonna do?
It may not generate anything useful right now (Score:1)
Re:It may not generate anything useful right now (Score:2)
Anyway, ordinary slide rules were commonly used by engineers up until pocket calculators became available (which I guess would be the 1960's or so...). It is the only way to quickly multiply large numbers by hand (unless you're Rainman and can do it in your head).
In case you don't know, logarithms are rather simple.
Say you want to find A*B, where A and B are rather large numbers and you don't want to multiply them by hand. log(A*B) = log(A) + log(B), a useful property. So find log(A) and log(B) using your slide rule. Add them. Then do the inverse log. That's A*B. Multiplying by using addition and tables of logarithms. Fun stuff, huh?
And yes, it works with any "base" for the logarithm, base e (the "natural" log), base 2, base 10, whatever.
Re:It may not generate anything useful right now (Score:2)
?????
You're heart's in the right place but your facts are way wrong on this one. Logarithms were developed for the purpose of changing a then-hard problem (multiplication) into an easy one (addition). They were useful for centuries before the 20th. Read any standard text on the history of mathematics.
Re:Real world applications? (Score:2)
Re:Real world applications? (Score:3, Insightful)
A particular base expression of a number is not the number, it's a representation of the number. There are plenty of ways to express a number that don't involve any base, much less base 10. To me, interesting mathematical properties are independent of the expression of the number, like primality, arithmetic properties, whether it's algebraic or trancendental, etc.
The notion of 'palindrome' doesn't apply to numbers at all. It may apply to your representation of the number, but I can come up with a representation that is or is not a palindrome for any number you like. I just don't get the interest.
Re:Real world applications? (Score:2)
Re:Real world applications? (Score:2)
It took most people a while to understand (long office hours). Some people never understood the difference. They got really lost when I got to 1's and 2's complement.
The title of the article states that it's an amateur search. I can't see why a professional would bother. It's entirely unique to beings with 10 fingers and doesn't exsist in Plato's world of numbers.
Kind of like when the date and time was 20/02/2002 20:02. It's kind of cool, but just an artifact of how Americas represent dates and times.
Arbitrary definition of a palindrome? (Score:4, Insightful)
Re:Arbitrary definition of a palindrome? (Score:1)
A solution waiting for the problem.
Re:Arbitrary definition of a palindrome? (Score:2)
As for the use of base-10 rather than another base... probably because we have 10 fingers?
Re:Arbitrary definition of a palindrome? (Score:2)
Re:Arbitrary definition of a palindrome? (Score:3, Insightful)
To get into the mind of a mathematician, you must understand the cardinal rule of math - that there is no such thing as an uninteresting number. All numbers have interesting aspects about them (strange prime factorizations, that they're palindromes, that they're the smallest sum of three consecutive cubes, whatever) but here's the real kicker - there's no such thing as an uninteresting number because if anybody was to ever find an unintereting number that had absolutely nothing special about it, it would be interesting purely for the reason that it doesn't have anything interesting about that.
Grasp that, and you can grasp why people do things like this. It's an intellectual exercise that some happen to like quite a bit.
Re:Arbitrary definition of a palindrome? (Score:3, Interesting)
Re:Arbitrary definition of a palindrome? (Score:2)
You can do that to every number in at least one base. What definitely would be interesting is to find some number it only works for in its own base. Or to find some special properties of numbers that are defined by what bases it works in, how many steps it takes in each base...
In any case - and I'm sure you've heard this a lot - it doesn't matter that there's no apparent useful application. Stop being so practical.
Generalization to arbitrary bases (Score:3, Interesting)
http://www.mathpages.com/home/kmath312.htm [mathpages.com]
Why? (Score:1)
Interesting, Inspiring and math script kiddie (Score:1)
I thought it was great that someone without a lot of math background but a hell of a lot of energy could jump right in and make a difference. I have a great education and background and haven't done as much. I feel ashamed. I gotta start rockin!
It was funny that he doesn't fully understand the math, the programs and still gets things done. He just gets programs that others have created and puts them to use. A math research script kiddie. There should be a website for this. Dump off your interesting math code and people can download and run those that are interesting.
math research script kiddie (Score:2)
Couldn't have said it better myself. I guess a lot of people haven't paid any attention to what Wolfram is trying to say in his new book: this kind of weird algorithmic pattern shit is as common as sand on a beach. Around 1983 people were playing around with wondrous numbers, which at least has the replayability advantage of not producing a monotonic sequence.
My first curse upon the world: this problem has a proof that involves analyzing 100,000 special cases producing 10,000 pages of dense results, and none of these cases can be reduced.
My second curse upon the world: some idiot bothers to find it.
The suggestion that no pure mathematician has any clue about where to begin is not equivalent to saying no pure mathematician has any clue about whether to begin. A proof is hardly worth the paper it gets published on if it doesn't reflect back on other branches of theory.
Wrong approach? (Score:2)
Re:Wrong approach? (Score:2)
> point not yet calculated?
Yes, it was proved over a century ago by Ferdinand Lindemann.
Re:Wrong approach? (Score:2)
All the apathy here... (Score:2, Interesting)
This may seem like a trivial and silly waste of time, and it probably is, but the number 196 is interesting. Why? Read this quote:
Whether all numbers eventually become palindromic under this process is unproved, but all numbers less than 10,000 have been tested. Every one becomes a palindrome in a relatively small number of steps (of the 900 3-digit numbers, 90 are palindromes to start with and 735 of the remainder take less than 5 reversals and additions to yield a palindrome). Except, that is, for 196. This number had been carried through 50,000 reversals and additions by P. C. Leyland, yielding a number of more than 26,000 digits without producing a palindrome. Later, P. Anderton continued the process up to 70,928 digits without encountering a palindrome.
ALL numbers up to 10,000 become palindromes very quickly... except for the number 196?
Re:All the apathy here... (Score:4, Insightful)
Until and unless there's a proof of why Lychrel numbers exist, the whole concept is quite uninteresting beyond a passing "neat".
Re:All the apathy here... (Score:2)
Of course, I too wonder what in the hell this is good for.
Re:All the apathy here... (Score:2)
Sort of like the chance of finding the string "333" in decimal Pi, versus finding "3333333333333333333333333". Both are in there, multiple times even, but its obvious one is much more likely than the other. 50 was arbitrary though, it might be 20 or 100. You get the idea.
Re:All the apathy here... (Score:2)
Hence the probability that a number of length 2*n will immediately form a palidrome is 1/(2^(n-1)) for each iteration.
On average, the number gains 0.5 digits per iteration of the algorithm. Consequently for a number with 2*n digits, after infinite iterations, you expect to have encountered a number of palindromes approximately equal to Sum(1/2^(n-1+k/2)), k=0 to infinity => ~6.8*2^(-n).
A straight forward density argument shows that there have to be some Lychrel numbers and that most numbers with a large number of digits are Lychrel numbers, but of course it doesn't tell you which particular numbers have this property.
Obviously I haven't been entirely rigorous, but afterall this is slashdot.
Re:All the apathy here... (Score:2, Insightful)
196 + 691 = 887
887 + 788 = 1675
1675 + 5761 = 7436
Clearly, if any of 887, 1675, or 7436 eventually lead to a palindrome, then so will 196. So why do people just keep talking about the special 196? It might be the first, but certainly not the only one < 10,000.
Re:All the apathy here... (Score:2)
Yes, that's a good point. I believe whats special is that 196 is the start of this chain, and only numbers this is true for are the ones in this chain. The question is: do they have a special property, or is it just some kind of base 10 fluke?
Re:All the apathy here... (Score:2)
The "magic" of 196 (Score:2, Interesting)
The plot showing the sequence of iteration-to-palindrome depths for each integer is available here [arizona.edu].
The Lychrel numbers (iteration depth>10000) are colored red. Interesting, the maximum non-Lychral depth (number of iterations until palindrome) was 24, which occurs right away at 89 (try it, its a fun one). After that, the depths recur in similarly patterned blocks, with a typical spacing of about ~100 (or occasionally a very close spacing of only 2), and some interesting gaps. The first few Lychrel numbers:
Can you spot the patterns in this sequence? The only thing special I can see about 196 is it is the first Lychral number!
Re:All the apathy here... (Score:5, Insightful)
By definition the numbers 691, 887, 788, 1675, 5761, 7436, and 6347 must also have the same problem, since they're in the chain following 196.
196 + 691 = 887
887 + 788 = 1675
1675 + 5761 = 7436
7436 + 6347 = 13783
Re:All the apathy here... (Score:2)
Re:All the apathy here... (Score:2, Informative)
Read the article. These numbers don't count exactly because they follow in that chain. Only the seed of a chain counts.
It's not true, though. (Score:3, Informative)
A Perl Script to Find Lychrel Numbers :-) (Score:2)
The only problem is doesn't work when the numbers are _really_ large (like hundreds of characters long), I think that's an issue with one of the functions
#!/usr/bin/perl
# Stupid Perl script to find Lychrel numbers.
# Yeah yeah inefficent, but very quick and easy to write
# Iain Collins, iain_collins@mac.com
use Math::BigInt;
use Strict;
my $start_number = $ARGV[0];
print "Searching For Lychrel Number, starting at: $start_number....\n";
my $forward_number = $start_number;
my $reversed_number = reverse($forward_number);
my $result;
my $result_tmp;
my $i = 0;
my $count = 0;
while ($i == 0) {
my $n = Math::BigInt->new($forward_number);
$count++;
$result = $n->badd($reversed_number);
$result =~ s/\+//g;
$forward_number =~ s/\+//g;
$reversed_number =~ s/\+//g;
print "$count: $forward_number + $reversed_number = $result\n";
$result_tmp = reverse($result);
if ($result_tmp == $result) {
print "Palendrome Found?\n";
$i++;
}
$forward_number = $result;
$reversed_number = reverse($forward_number);
}
BUGFIX: A Perl Script to Find Lychrel Numbers (Score:2)
This versions works, even with ReallyBigNumbers...
#!/usr/bin/perl
# Stupid Perl script to find Lychrel numbers.
# Yeah yeah inefficent, but very quick and easy to write
# Iain Collins, iain_collins@mac.com
use Math::BigInt;
use Strict;
my $start_number = $ARGV[0];
print "Searching For Lychrel Number, starting at: $start_number....\n";
my $forward_number = $start_number;
my $reversed_number = reverse($forward_number);
my $result;
my $result_tmp;
my $i = 0;
my $count = 0;
while ($i == 0) {
my $n = Math::BigInt->new($forward_number);
$count++;
$result = $n->badd($reversed_number);
$result =~ s/\+//g;
$forward_number =~ s/\+//g;
$reversed_number =~ s/\+//g;
print "$count: $forward_number + $reversed_number = $result\n";
$result_tmp = reverse($result);
if ($result_tmp eq $result) {
print "Palendrome Found?\n";
$i++;
}
$forward_number = $result;
$reversed_number = reverse($forward_number);
}
Proof for 196 (Score:3, Funny)
(Apologies to Fermat.)
Re:Go to either -1 or GeoCities (Score:3, Interesting)
Besides explaining the joke you so obviously missed, it is an excellent book about mathmatics generally - and this is from someone who detests maths. I only wish this was around when I was doing maths in high school and i'd been forced to read it. Oh well...
Cpu Cycles (Score:2, Insightful)
Fractal Drawing (Score:2)
DZM
Of the 90 that start as palindromes... (Score:2)
The first question that comes into mind... (Score:2)
Re:The first question that comes into mind... (Score:2)
There can't be more palindromic numbers than natural numbers since each palindromic number is a natural number. And since we measure infinities by putting sequences in correspondence with the natural numbers, the size of the set of palindromic numbers cannot exceed the size of the set of natural numbers. Consult W. Rudin's "Real Analysis" for a good proof of this.
If there is only a finite number of palindromic numbers than a computer could exhaustively search and enumerate all of them. Then again, how would we know that we've reached the end? They could be very spaced out. What we need is a mathematical proof.
However, number theory is a very hard nut to crack. The algebraic structure of numbers is quite elusive. Showing how many palindromic numbers there are one way or the other is probably going to be exceedingly difficult. If not because number theory is hard but because there is no practical interest in this subject.
The sets are of equal size (Score:2)
Then again, how would we know that we've reached the end? They could be very spaced out. What we need is a mathematical proof.
You can't reach the end. Any number whose digits are all less than 5 is obviously palindromic, and the set of such numbers is countably infinite. Thus, the set of palindromic numbers is not smaller than the set of natural numbers.
Since, as you pointed out, the size of the set of palindromic numbers cannot exceed that the set of natural numbers, the sets are of equal size.
Re:set is the same size as naturals (Score:2)
So we could run into a problem if there is a palindromic number that when multiplied by 2 is no longer a palindrome. Any thoughts?
Re:set is the same size as naturals (Score:2)
Three Years Of Computing (Score:3, Interesting)
computer geek's battle with this number.
http://www.fourmilab.ch/documents/threeyears/th
The account reminds me that computers are more
for just word processing and surfing the web. We
can explore interesting and amusing phenomenon
with them. I wish I weren't so jaded.
A little logic (Score:5, Insightful)
It seems like the best way to produce a palindrome on the next step is for the sum of the kth digit and the kth-from-the-end digit to be less than 10. Then there will be no carries and we get a nice palindrome.
For random numbers, the chance of this being true is 1/2 for each digit in the first half of the number. Therefore with a number of length 2n digits, the chance that it will be palindromic on the next step is 1 in 2^n. (That' s one in two-to-the-nth power.)
If a number is not a palindrome on one step, it will become about one digit longer from the reverse-and-add. So at each step that it is not palindromic, the chance that it ever will become palindromic decreases.
From this perspective, it's not surprising that most small numbers become palindromes after a few steps, but that as we get to larger numbers we will find more and more that seem to never become palindromic. After some length the chance of ever again getting a palindrome is so remote that there is no point in continuing - your computer is more likely to make a mistake than for the number to happen to have the special form that can create a palindrome.
196 just happens to be a number which "gets lucky", it escapes out of the small-number region where most form palindromes. Once you get past a dozen or so steps you'll probably never get a palindrome.
There doesn't have to be anything special about 196, it's all a matter of chance and odds.
That's how I see it, anyway.
Why? (Score:2)
False assertion in Fourmilab paper (Score:2)
This is an assertion from John Walker's Three Years Of Computing [fourmilab.ch]. Several other sites reference this statement and it appears to be over generalized. Certainly for any addition of this form the sum is a palindrome but not all digit-reversed sums that are palindromes are of this form. For example conside
74 + 47 = 121
or
7744 + 4477 =12221
These are only a few counter examples. There may be some general rule on how to generate all such numbers.
I hope this statement isn't fundemental in any greater works.
Fairly Simple Perl Script (Score:2)
The program will print out the number of time's it's looped (the number of numbers it's tried), and then what the number is. Every million numbers (I wanted it to be big enough that it wasn't printing out miles of crap, but small enough that I got occasional outputs to know what it was up to), it prints out the time elapsed, the number of repititions, and the current number.
#!/usr/bin/perl
$in = $ARGV[0];
for ($x = 1; $x <= $in; $x++) {
$reverse = reverse($in);
$in = ($in + $reverse);
$back = reverse($in);
if ($in == $back) {
print "$x\t$in\n";
exit;
}
if ($x % 1_000_000 == 0) {
$time = (time - $^T);
print "\tat $x... $time sec elapsed... $in\n";
}
}
# the end...
Constructive criticism and whatnot is welcomed. (And yes, I know, my variable names suck...)
Re:Fairly Simple Perl Script (Score:2)
Re:Fairly Simple Perl Script (Score:2)
But I'm beginning to wonder... Answers very quickly get expressed as integers like "1.40025556644157e+15"... Does a reverse() of this return 51+e7...", or does Perl have the "real" number internally? My script doesn't work for long if the former is the case.
No, Perl does not perform arbitrary precision integer arithmetic.
Try perl -e 'print scalar reverse (2**60);', for example.
Also, I don't understand why you're using $x <= $in as the test case for your loop. $in will grow much faster than $x.
Re:Fairly Simple Perl Script (Score:2)
Now that I think of it, I'm not sure what's with either, but it seems to work for smaller numbers at least.
I hate when I write code, and then later don't understand why something works... Thanks for your comments, though.
A Perl script for Buddha (Score:2)
(ps-yes, it was nicely formatted and commented, but the LAMENESS filter rejects code like that.
# Do some perl madness
sub FindPalindrome { my ($value) = @_; for (my $j=1; $j=10000000; $j++) { $value += reverse($value); if ($value==reverse($value)) { print("$_[0] found in $j steps, palindrome of $value.\n"); return $j; } } print("$_[0] might be a Lychrel number!\n"); return $j; } { for (my $i=0; $i1000; $i++) { FindPalindrome($i); } }
Re:A Perl script for Buddha (Score:2)
Your program will flag anything as a possible Lychrel number once it gets to the point where Perl represents it in scientific notation, which will always happen in way less than 10,000,000 iterations. In fact, it will always happen in less than 70 iterations. Stick $value in the string printed if it might be a Lychrel number to see what I'm talking about.
Re:A Perl script for Buddha (Score:2)
Thank goodness! (Score:2)
Re:Is this really maths? (Score:2)
Re:Is this really maths? (Score:2)
Re:Bah (Score:2)
Re:Palindrome?! (Score:2)
The term is more usually used for words or sentences that have the same property of reversibility (spaces are generally ignored), such as "madam, I'm adam".
Re:Okay, the facts... (Score:2)
Re:Okay, the facts... (Score:2)
I can't think of any way to parallelize the iterative reverse/add process itself...
Re:Okay, the facts... (Score:2)
No really. Unless you have 2 or 7 or 60 fingers.