Slashdot Mirror


Amateur Quest For Lychrel Numbers

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."

89 of 310 comments (clear)

  1. Simple Example by teetam · · Score: 5, Interesting
    Consider 196:
    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!!!

    --
    All your favorite sites in one place!
    1. Re:Simple Example by cperciva · · Score: 3, Informative

      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 /.

      You aren't talking about this by any chance, are you?

    2. Re:Simple Example by teetam · · Score: 2

      Nice to see /. posting that story, even if mine was rejected. Thanks for pointing me to the story.

      --
      All your favorite sites in one place!
    3. Re:Simple Example by SuperguyA1 · · Score: 2

      Actually what the article says is that all numbers under 5000 or something like that fall into one of 3 'seeds'. for example 196 would be a seed 887.

      --
      "as plurdled gabbleblotchits on a lurgid bee" - Prostetnic Vogon Jeltz. (One man's humorous is another mans flamebait)
  2. Re:what? by cperciva · · Score: 5, Informative

    256 + 652 = 908
    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.

  3. who cares? by stipe42 · · Score: 2, Insightful

    I'm rather partial to odd occurences, patterns and facts about numbers and number theory. But I could not find anything on any of the linked pages that could explain why this is interesting. All it seems to be is a variation on: 'well if you take this really convoluted and arbitrary iterating test, every number will work with enough iterations. Except for this one number.' It seems to me that just about any arbitrary iterating test will work for all numbers except for a handful. In order to differentiate the test there must be something unique about it. Are the numbers useful? Do the numbers correspond with numbers found by another test, like every other prime number or something? If not it's just very complicated numerical eeny-meenie-minie-moe.

    stipe42

  4. In a nutshell.... by moniker_21 · · Score: 2, Informative

    Pick a number, any number. Reverse the digits in the number, add those reversed digits to the original number. Does this sum create a palindrome? If not, repeat the process with the new sum. By example:

    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.

    --
    I posted to /. and all I got was this stupid sig
    1. Re:In a nutshell.... by Andrew+Allan · · Score: 5, Funny

      I've found another one!!!

      Try doing it with 691! ;-)

    2. Re:In a nutshell.... by tealover · · Score: 4, Insightful

      If you're going to copy stuff, you should at least give credit or show a link to the site that you're stealing from.

      This link comes from a link on the www.p196.org page.

      Moderators: Please mod the parent poster down for dishonesty.

      Thanks.

      --
      -- You see, there would be these conclusions that you could jump to
    3. Re:In a nutshell.... by Uruk · · Score: 2, Interesting

      Here's simple code to check this property for all numbers from 0 to 100 - adjust to test it for arbitrary numbers: (Do NOT run this on numbers that don't have known palindromes since it will cause a stack overflow. :)

      #!/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

      --
      -- Truth goes out the door when rumor comes innuendo. -- Groucho Marx
    4. Re:In a nutshell.... by tesmako · · Score: 2, Funny

      I hate you. I spent an hour writing a program to calculate these damn numbers and crunching on 691 before I got the joke :P Oh well, I learnt a bit of GMP in the process, guess it was not all wasted.

    5. Re:In a nutshell.... by plaa · · Score: 2

      This article is saying that for the thousands of numbers tested, every one except 196 has exhibited this property.

      Wrong, 196 is though to be the smallest integer with this property. Check the integer sequence 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...)

      --

      I doubt, therefore I may be.
    6. Re:In a nutshell.... by plaa · · Score: 3, Insightful

      (I'd bet there are either infinitely many such numbers or none...)

      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.

      --

      I doubt, therefore I may be.
    7. Re:In a nutshell.... by Kredal · · Score: 2

      Moderators! Attack! The previous poster didn't give credit for his sig, which all self-respecting geek will know comes from Office Space!

      --
      Whoever stated that signature sizes should be limited to one hundred and twenty characters can just go ahead and kiss my
  5. Real world applications? by MattC413 · · Score: 4, Interesting

    What are some real-world applications that this process generates?

    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

    1. Re:Real world applications? by Tablizer · · Score: 2

      (* There HAS to be some useful purpose to this.. There must be, or it wouldn't be the way it is! *)

      What else are unemployed trivia-loving geeks gonna do?

    2. Re:Real world applications? by feed_me_cereal · · Score: 2

      OK, I just read about these numbers for the first time just now, but I'd guess that there isn't a lot of significance to them. I mean, if you're looking at the digits, then it becomes relevant that you're using base-10. Usually in these sorts of cases, you only find important stuff in dealing with base-2. But then again, this is just my ever-so-slightly educated guess. If anyone really does know how these numbers may be significant, I'd like to hear it!

      --
      "Question with boldness even the existence of a god." - Thomas Jefferson
    3. Re:Real world applications? by wurp · · Score: 3, Insightful

      I don't understand why this is interesting at all. These properties only matter for numbers expressed in base 10 (I mean, for other bases other numbers might exhibit the property, but the property is inherent to a standard base expression of the number).

      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.

    4. Re:Real world applications? by grytpype · · Score: 2

      You know, I sensed some bogosity here, but I couldnt' quite tell what it was. I think you've put your finger on it. Are there any interesting number-theoretical properties that depend on what base you express the number in?

      --

      - Have a picture

    5. Re:Real world applications? by DustMagnet · · Score: 2
      People seem to have a very hard time seporating numbers from their representations. I used to teach a course on computer representation (int, float, machine language). I used to start one lecture by writing the numeral five on the board and explaining it wasn't five. Just a representation of five. Maybe I should have started with "cat". People don't that the letters C-A-T aren't a cat.

      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.

      --
      'SBEMAIL!' is better than a goat!!
  6. Arbitrary definition of a palindrome? by PseudoThink · · Score: 4, Insightful

    Seems to me their palindrome test is a bit limited, since they only appear to be testing base-10 numbers. What's the use in that? Why not test base-2 or base-16 or whatever? Probably because there is no useful application to this arithmetic curiosity?

    1. Re:Arbitrary definition of a palindrome? by Papineau · · Score: 2

      Not just the test. The digits reversing part is also based on base-10. Could be interesting to mix the bases for the test and the reversing.

      As for the use of base-10 rather than another base... probably because we have 10 fingers? :P

    2. Re:Arbitrary definition of a palindrome? by Uruk · · Score: 3, Insightful

      Since when does pure mathematics need to have an obvious application? Some people study math just because it's interesting. Sometimes, people come up with areas of number theory that don't immediately look promising, but that later get developed into something very useful, like optimum golomb rulers, or the mathematics that goes into public key crypto.

      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.

      --
      -- Truth goes out the door when rumor comes innuendo. -- Groucho Marx
    3. Re:Arbitrary definition of a palindrome? by xenocide2 · · Score: 3, Interesting

      Of course, this leads to such quote by Cramer or Cauchy or someother such famous mathematician: "When I suddenly find anything useful concerning my work, I stop."

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

    4. Re:Arbitrary definition of a palindrome? by grammar+fascist · · Score: 2

      Try base 196. It works in that: 10 + 01 = 11! Wow!

      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.

      --
      I got my Linux laptop at System76.
    5. Re:Arbitrary definition of a palindrome? by feed_me_cereal · · Score: 2

      yeah, but having 10 fingers isn't important to general mathematics. In this context, it's arbitrary.

      --
      "Question with boldness even the existence of a god." - Thomas Jefferson
  7. Wrong approach? by sfraggle · · Score: 2

    It seems to me that this is the wrong kind of approach to this problem. They would be much better trying to find a generalised proof. You can search as high as you want but you can never prove that the next iteration will not yield a palindromic number otherwise. The difficult part to me seems to be to describe the problem in a simple mathematical form that can be analysed.

    --
    were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
    1. Re:Wrong approach? by sfraggle · · Score: 2

      > Can you prove that Pi does not repeat at some
      > point not yet calculated?

      Yes, it was proved over a century ago by Ferdinand Lindemann.

      --
      were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
    2. Re:Wrong approach? by sfraggle · · Score: 2

      Whoops, my mistake. Lindemann proved Pi is transcendental but Johann Lambert proved earlier (1768) that Pi is irrational, enough to show that the digits will never repeat

      --
      were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
  8. All the apathy here... by Sivar · · 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?

    --
    Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
    1. Re:All the apathy here... by pomakis · · Score: 4, Insightful
      What would be interesting is coming up with a proof of why 196 exhibits this peculiar property. Until then, it's actually impossible to prove that a number is a Lychrel number. In fact, it's impossible to prove that there are any Lychrel numbers. Whose to say that the 20 billionth iteration of 196 isn't going to result in a palindrome?

      Until and unless there's a proof of why Lychrel numbers exist, the whole concept is quite uninteresting beyond a passing "neat".

    2. Re:All the apathy here... by xanth · · Score: 2, Insightful

      196 _can't_ be the only number < 10,000 with this property of never generating a palindrome. In fact, 887, 1675, and 7436 must also have this property:

      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.

    3. Re:All the apathy here... by ddstreet · · Score: 5, Insightful
      ALL numbers up to 10,000 become palindromes very quickly... except for the number 196?

      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

    4. Re:All the apathy here... by RickHunter · · 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?

    5. Re:All the apathy here... by NoMoreNicksLeft · · Score: 2

      It's obvious to me anyway, on an intuitive level, that if an iteration goes beyond a few digits in size, the likelyhood of it palindroming plummets. I bet number of non-Lychrels that require 50+ iterations is unbelievably low, or even zero.

      Of course, I too wonder what in the hell this is good for.

    6. Re:All the apathy here... by Sivar · · Score: 2

      That's true. I need to stop posting right after I get up. :)

      --
      Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
    7. Re:All the apathy here... by NoMoreNicksLeft · · Score: 2

      Well, the fact that it's limited to integers, and that the possibility of a string of n decimal digits matching such a pattern, when n grows with each iteration like it does.

      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.

    8. Re:All the apathy here... by blonde+rser · · Score: 2

      Numbers that resolve into the series also have the same characteristic... for example 295 + 592 = 887 394 + 493 = 887 689 + 986 = 1675 Prove it for 196 and all these numbers fall with it.

    9. Re:All the apathy here... by dragons_flight · · Score: 2

      Given a 2*n digit number, it suffices to generate a palindrome if the sum of the i-th and (2n-i+1)-th digit is less than 10 for all i between 1 and n. It follows that at least (2n)/(2^n) numbers of length 2*n will immediately form palindromes. While less obvious, it is also true that if the sum of the i-th and (2n-i+1)-th digit is greater than 10 then the next iteration can only generate a palindrome if the sum of every digit and it's counterpart is greater than 10 (e.g. 9292 -> 12221). Not all numbers with this property will immediately form palindromes (e.g. 9393 -> 13332), but it is a requirement. This property holds for an additional (2n)/(2^n) numbers.

      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.

    10. Re:All the apathy here... by Prune · · Score: 2, Informative

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

      Read the article. These numbers don't count exactly because they follow in that chain. Only the seed of a chain counts.

      --
      "Politicians and diapers must be changed often, and for the same reason."
  9. Re:what? by norwoodites · · Score: 3, Funny

    There is one misprint:
    256 + 652 is not 908 but 808.

  10. Re:what? by EvanED · · Score: 2

    Try again; 908 is correct.

  11. Proof for 196 by dave_mcmillen · · Score: 3, Funny

    The number 196 NEVER becomes a palindrome, no matter how many iterations you do. I have assuredly found an admirable proof of this, but the Post Comment box is too narrow to contain it.

    (Apologies to Fermat.)

  12. Re:what? by norwoodites · · Score: 2

    I just noticed that, I cannot add.

  13. Re:what? by (startx) · · Score: 2

    actually, the original poster is correct, 256+652 IS 908, not quite sure how you got 808

  14. Re:Is this really maths? by jaavaaguru · · Score: 2

    Then doesn't it seem a huge coincidence that nearly ALL number that have this procedure applied to them come out as palindromes? That has got to be significant. We just don't know why yet.

  15. Cpu Cycles by Mister+Transistor · · Score: 2, Insightful

    I think that my "extra" CPU cycles would be much better put toward distributed AIDS or cancer research. SETI seems somewhat of a waste of time, pedantic stuff like this even more.

    --
    -- You are in a maze of little, twisty passages, all different... --
  16. Re:Bah by Kwikymart · · Score: 2

    yah, we could use base 36 (digits + 26 letters) and try to get "racecar" out of it.

    --

    Buying a Dell computer is equivalent to dropping the soap in a prison shower.
  17. It's not true, though. by dark-nl · · Score: 3, Informative

    879, 1997, and 7059 also have this property, whatever it is. The guy even explains this on his site. I wonder who he is, and why he doesn't put his name anywhere.

  18. Fractal Drawing by DennisZeMenace · · Score: 2

    If anyone has some time to waste, it'd be fun to create a fractal drawing of it. Well it's not really a fractal, since it's integer, but anyway. It'd be only a single line of pixels (or a symmetric 2d reflection), and the color code represents how many iterations it took to reach a palindrome. I'm guessing it may not look real spectacular, but who knows...

    DZM

  19. Of the 90 that start as palindromes... by NoMoreNicksLeft · · Score: 2

    Did he ever bother to check if they're the palindromic result of a smaller non-Lychrel number?

  20. Re:Is this really maths? by ziriyab · · Score: 2

    Just because there is no symbol associated with a mathematical manipulation doesn't mean it's not a math problem.

  21. The first question that comes into mind... by Wolfier · · Score: 2

    Is the set of all palindromic numbers of the same 'size' as all natural numbers?

    1. Re:The first question that comes into mind... by Eharley · · Score: 2

      So you want to know if there is an infinite number of palindromic numbers? Probably.

      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.

  22. Generalization to arbitrary bases by Raiford · · Score: 3, Interesting
    Check the sites on this. There are generalizations of the phenomenon to arbitrary bases

    http://www.mathpages.com/home/kmath312.htm

    --
    "player 4 hit player 1 with 0 stroms"
  23. palidrome vs number bases by Alien54 · · Score: 3, Interesting
    and contining on for a few million digits still doesn't end up at a palindrome.

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

    --
    "It is a greater offense to steal men's labor, than their clothes"
    1. Re:palidrome vs number bases by cperciva · · Score: 2

      I imagine there may be more palidromes in a base two system, vs, say, a base 666 system. (to choose an arbitrary base).

      No. In any base, the number of palindromes less than n is O(n^(1/2)).

  24. Re:who cares? by DrSkwid · · Score: 2

    Binary computers actually arrived on the scene over 200 years after Boolean algebra was invented and refined by George Boole and first presented in a paper by him in 1854.

    "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.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  25. Re:Palindrome?! by Andy_R · · Score: 2

    If you reverse the digits of a number and get the original number again, it is palindromic.

    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".

    --
    A pizza of radius z and thickness a has a volume of pi z z a
  26. Three Years Of Computing by Eharley · · Score: 3, Interesting

    There is a very nice account of one famous
    computer geek's battle with this number.

    http://www.fourmilab.ch/documents/threeyears/thr ee years.html

    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.

  27. OT: Stack Overflow in Perl by bentini · · Score: 2
    (Do NOT run this on numbers that don't have known palindromes since it will cause a stack overflow. :)

    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)...

  28. A little logic by SiliconEntity · · Score: 5, Insightful

    I'm not familiar with this problem, so what I'm going to say is probably well known to students in the field.

    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.

  29. A Perl Script to Find Lychrel Numbers :-) by @madeus · · Score: 2

    While I've been wating for the film to start I came up with this....

    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);
    }

  30. BUGFIX: A Perl Script to Find Lychrel Numbers by @madeus · · Score: 2

    Of couse, was using "==" to check for matches (Perl wiggs out at this). Testing for matches by treating the values as a string works fine. (i.e. by using "eq" instead of "==").

    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);
    }

  31. Why? by Snaller · · Score: 2

    .... erm ... yeah... but why? Do they expect to find a message from God... or?

    --
    If Google really cared they would fix Android Chrome to reflow text, instead of discriminating
  32. Re:Go to either -1 or GeoCities by jbrw · · Score: 3, Interesting
    You need to go read "Fermat's Enigma: The Epic Quest to Solve the World's Greatest Mathematical Problem" which appears to be the name for the US edition of Simon Singh's excellent book, published in the UK under the name of "Fermat's Last Theorem".

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

  33. Re:set is the same size as naturals by Eharley · · Score: 2

    But I think that the idea is that you have to reverse and add the digits of the number at least once before it is a palindrome.

    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?

  34. False assertion in Fourmilab paper by blonde+rser · · Score: 2

    In order for addition of a digits-reversed number to yield a palindrome, there must be no carries in the addition and hence each pair of digits must sum to 9 or less.

    This is an assertion from John Walker's Three Years Of Computing . 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.

  35. Fairly Simple Perl Script by suwain_2 · · Score: 2

    Being the insane geek I am, I quickly whipped up a Perl script that I *think* works. I tested it with an example given (87), and got 4884, which is correct.

    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...)

    --
    ________________________________________________
    suwain_2 :: quality slashdot p
    1. Re:Fairly Simple Perl Script by suwain_2 · · Score: 2

      Sorry for the entire comment being fixed-width... I put my code in tags, and that didn't seem to work so well... So I changed the whole thing to code and hit submit. BTW, 12 million repititions in 176 seconds, and nothing found... 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.

      --
      ________________________________________________
      suwain_2 :: quality slashdot p
    2. Re:Fairly Simple Perl Script by jareds · · 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.

    3. Re:Fairly Simple Perl Script by suwain_2 · · Score: 2
      Ugh... It was kind of written in five minutes, without a whole lot of thought.

      Now that I think of it, I'm not sure what's with
      $x <= $in
      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.
      --
      ________________________________________________
      suwain_2 :: quality slashdot p
  36. Re:what? by Tokerat · · Score: 2

    He already has one! Didn't you say he had a Mac... :-P

    --
    CAn'T CompreHend SARcaSm?
  37. Re:It may not generate anything useful right now by Cryptnotic · · Score: 2

    Hey man, slide rules helped end WWII. Bombadiers used slide rules to calculate when to drop a M pound bomb from a plane moving at V mph at an altitude Y to hit a target at some distance D in front of the plane. Those aren't simple slide rules, they're often two or three dimensional things custom made for certain types of bombs or aircraft or whatever. Anyway, back when computers took up the entire wing of a building, they didn't have automatic targetting computers in warplanes.

    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.

    --
    My other first post is car post.
  38. Re:It may not generate anything useful right now by dillon_rinker · · Score: 2

    Yet all it was useful for until the 20th century was slide rules.

    ?????

    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.

  39. The "magic" of 196 by floateyedumpi · · Score: 2, Interesting
    I was interested in the magic of the number 196, so I computed the "palindrome yield" for all numbers up to 3000. I defined as a "Lychrel number" any for which no palindromic sum was found after 1000 iterations. Remember that the probability for a subsequent number in the series to yield a palindrome when summed with its reverse is .45^(n) where n is the number of digits in that number. At a depth of 1000, n~400, and the probability is ~1e-140!!! Of course, it's not really random, for why else could the number 89 succeed with a palindrome of length 13 (probabilitly 3e-5). However, as you'll see, we could have chosen a cutoff of 100 or even 30.

    The plot showing the sequence of iteration-to-palindrome depths for each integer is available here.

    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:
    196, 295, 394, 493, 592, 689, 691, 788, 790, 879, 887, 978, 986, 1495, 1497, 1585, 1587, 1675, 1677, 1765, 1767, 1855, 1857, 1945, 1947, 1997, 2494, 2496, 2584, 2586, 2674, 2676, 2764, 2766, 2854, 2856, 2944, 2946, 2996

    Can you spot the patterns in this sequence? The only thing special I can see about 196 is it is the first Lychral number!
  40. Well, except for... by UberQwerty · · Score: 2

    ...all of its children. After each iteration beginning with 196, you get another number that will never become a palindrome.
    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?

    --


    PUBLIC SPLIT ON WHETHER BUSH IS A DIVIDER -CNN scrolling banner, 10/15/2004
  41. The sets are of equal size by jareds · · 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.

  42. A Perl script for Buddha by The+Panther! · · Score: 2

    Sorry, I wrote this on my windows machine at work, so I don't have a proper sh-bang at the top, but this'll tell you whether or not a number converges to a palindrome in less than 10,000,000 iterations, and if so, where and how. A preliminary run took a long time. :-) Drop the iterations down to about 1,000 and it's pretty quick, and gives you an idea what might be interesting to explore.

    (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); } }

    --
    Any connection between your reality and mine is purely coincidental.
    1. Re:A Perl script for Buddha by jareds · · 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.

    2. Re:A Perl script for Buddha by The+Panther! · · Score: 2

      Quite right. I realized that when I tried to compute 1,000,000 iterations of 196. I had (mistakenly) thought that Perl operated on strings for integers, which would ultimately mean it internally supported BigNums. A minor change to the script to use Math::BigNum and it works fine, though quite a bit slower. :-)

      --
      Any connection between your reality and mine is purely coincidental.
  43. math research script kiddie by epine · · 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.

  44. Thank goodness! by flacco · · Score: 2

    I, for one, am glad they haven't thrown away that distributed processing power on something trivial like curing cancer instead.

    --
    pr0n - keeping monitor glass spotless since 1981.
  45. Re:who cares? by jandrese · · Score: 2

    Huh? Maybe you've changed the base on me without telling, but isn't 1854 + 200 == 2054?

    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.

    --

    I read the internet for the articles.
  46. Re:Okay, the facts... by spongman · · Score: 2

    okay, i gott ask, how are you parallelizing this? it seems like a serial operation to me.

  47. Re:Okay, the facts... by spongman · · Score: 2
    ah, so I assume this is for finding lychrels and not for finding the palindrome for 196?

    I can't think of any way to parallelize the iterative reverse/add process itself...

  48. Re:Okay, the facts... by Yunzil · · Score: 2

    Why not ask why we use base 10 for counting? Why not base 2, or 7, or 60? Just as meaningful of a question.

    No really. Unless you have 2 or 7 or 60 fingers. :)

  49. Re:set is the same size as naturals by Wolfier · · Score: 2

    Okay. The fact that the size of the sets are equal is actually really trivial. I was just posting my first thought if I were to attack the problem - I wanted to know what you guys think FIRST if you were to try solving this. :)

  50. Re:what? by jcoy42 · · Score: 2
    I just noticed that, I cannot add.

    It kills me that your email is from physics.uc.edu..

    --
    Never trust an atom. They make up everything.