Jump to content

Talk:Happy number: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Happy bases: "digits" is assumed to be base 10
Line 350: Line 350:


:::The lead doesn't mention the base but in practice it assumes base 10 and only defines one set of happy numbers: Those with base-10 representation 1, 7, 10, 13, 19, 23, 28, 31, .... Generally, if you say "digits" without saying a base, it is assumed to be base 10. The lead definition says "Starting with any positive integer, replace the number by the sum of the squares of its digits". This is generally considered equivalent to "Starting with any positive integer, replace the number by the sum of the squares of the digits in the base 10 representation of the number". Given the lead definition we could for example say "the number of days in January is a happy number" without writing the number at all or specifying how we normally prefer to write it. Later we have to explicitly mention other bases in order to extend the definition. [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 17:01, 10 March 2011 (UTC)
:::The lead doesn't mention the base but in practice it assumes base 10 and only defines one set of happy numbers: Those with base-10 representation 1, 7, 10, 13, 19, 23, 28, 31, .... Generally, if you say "digits" without saying a base, it is assumed to be base 10. The lead definition says "Starting with any positive integer, replace the number by the sum of the squares of its digits". This is generally considered equivalent to "Starting with any positive integer, replace the number by the sum of the squares of the digits in the base 10 representation of the number". Given the lead definition we could for example say "the number of days in January is a happy number" without writing the number at all or specifying how we normally prefer to write it. Later we have to explicitly mention other bases in order to extend the definition. [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 17:01, 10 March 2011 (UTC)

::::Hm, OK. Does anyone know if there is any base that has no happy numbers besides the obvious 1,10,100 etc.?


== 'a sun'????????? ==
== 'a sun'????????? ==

Revision as of 18:34, 10 March 2011

New Comment: 4 is not Happy

The secion, "Happy Primes" previously stated that adding 3 or 9 to 10 raised to a power always produces "Happy" numbers. However, 4 (= 100 + 3 ) is not. Further, the explanation for why 10 is Happy is flawed.

  • I restated it to:

All numbers, and therefore all primes, of the form and for n greater than 0 are Happy. To see this, note that

  • All such numbers will have at least 2 digits;
  • The first digit will always be 1 = 10n
  • The last digit will always be either 3 or 9.
  • Any other digits will always be 0 (and therefore will not contribute to the sum of squares of the digits).
    • The sequence for adding 3 is: 12 + 32 = 10 → 12 = 1
    • The sequence for adding 9 is: 12 + 92 = 82 → 64 + 4 = 68 → 100 -> 1

Explanation

All numbers, and therefore all primes, of the form and are happy.

This original statement is incorrect for instances below 10 as follows.

  • 4 fits the case yet is not Happy. The sequence for 4 is: 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4 (rinses and repeat, never progressing towards 1).
    • The originally stated rationale is, alas, flawed for numbers under 10:

note that these numbers yield values of either 12 + 02 + 02 + ... + 02 + 02 + 32 = 10 → 12 + 02 = 1

  • In this mathematically trivial case, 4 does not yield: 12 + 3, it yields simply 42.
  • The trivial case for adding 9 remains OK (as 1 + 9 = 10 → easily Happy), but the supporting statement remains inaccurate

12 + 02 + 02 + ... + 02 + 02 + 92 = 82 → 82 + 22 = 68 → 62 + 82 = 100 → 12 + 02 + 02 = 1

  • Again, 100 + 9 = 10, which breaks down to 12 + 02 and not 12+92 as suggested.

old comment

I removed the text:

It can be shown mathematically that no matter what the initial number t is, the sequence t0,t1,t2,.. will eventually settle between 1 and 163. What happens to this sequence after it is inside this interval can be estimated by a simple computation.
It turns out that the only alternative to ending up at 1 is to be stuck in the cycle
4, 16, 37, 58, 89, 145, 42, 20, 4, ...

as I couldn't find these claims in either reference, and I strongly doubt they've been proved. dbenbenn | talk 21:23, 28 Jan 2005 (UTC)

The second part is in the references. The first one I proved. I did not know on Wikpedia you must submit the proofs. What is a good way of proceeding about that? Assuming that the text fragment is accurate, and since it adds value to the article, maybe it should be left. What do you think? Oleg Alexandrov | talk 21:39, 28 Jan 2005 (UTC)
I should have given you more time to explain yourself. :) I got your message. I think, in the fragment above I said that it can be proved that things will settle between 1 to 163, and only from there on one can do some computerized checking. So, you want me to include the proof? It is not that hard.
Which reference do these facts appear in? Note that the second claim implies the first. I agree that if you can show any number eventually goes below 163, then it's simply a matter of checking those cases. dbenbenn | talk 21:48, 28 Jan 2005 (UTC)
OK, I made a mistake. In those references it was mentioned only that we either are in the cycle 4, 16, .... 4, or otherwise end up at 1.
You are right, it was not mentioned that you get stuck in 1 to 163, and what happens next.
So, I can prove that you get stuck in 1 to 163, and I had written a code to show what happens next, but that one was voted for deletion (which I think was appropriate).
So, we have 2 options. (a) Keep things the way they are now. (b) Put back the statement with the proof. What to do about the "fact" of what happens after you are between 1 to 163 I don't know. That can be checked only computationally.
Suggestions welcome. Oleg Alexandrov | talk 21:54, 28 Jan 2005 (UTC)
Are you referring to the MathWorld article? It says
"Unhappy numbers have eventually periodic sequences ... which do not reach 1 (e.g., 4, 16, 37, 58, 89, 145, 42, 20, 4, ...)."
E.g. means for example. The article does not say that unhappy numbers always end up in the 4, 16, ... cycle.
If you have a proof of this fact, I suggest that you should publish it. You're a postdoc, you need to publish papers! And once it's been peer reviewed, we can refer to it here no problem.
Additionally, I invite you to write your proof here on this talk page. I would be interested in seeing it. But I don't think it would be appropriate to include in the article until it's been peer reviewed. dbenbenn | talk 22:06, 28 Jan 2005 (UTC)
Got it! I did not know you guys are so strict about things, but that makes sense. So, let's drop it.
About the proof. The idea is quite simple. If you start with a large number, and sum the squares of its digits, then, as you might guess, what you get is much smaller than the original. If you do it several times, you keep on getting much smaller number each time, until you are between 1 and 1000. From there on, a bit more care is needed with calculations (but is still simple) to see how much further you can drop. For example, for 999 you end up after one step with 81+81+81 obviously, which is 243. From the range 1-243 the number with the largest sum of squares of digits is 199, for which you get 1+81+81=163. And from here on, a little program can check where you end up after several iterations.
This could make a nice math competition problem. But I agree with you, not worth the trouble puttin on Wikipedia. Oleg Alexandrov | talk 23:07, 28 Jan 2005 (UTC)

Er, um, let me back-pedal please. I hadn't actually thought about this sequence at all when I wrote the above. I had just assumed that things were difficult. Now having thought about it for a few minutes, I agree it's quite simple. Any number above 999 goes to a number with fewer digits, so you eventually get to something 999 or below. Then it's just a matter of checking. This level of reasoning can certainly go in the article. I'll start adding it right now. dbenbenn | talk 23:18, 28 Jan 2005 (UTC)

Done. For what it's worth, it was never about strictness. The problem was simply that no justification for the claims at the top of this thread were given. dbenbenn | talk 23:54, 28 Jan 2005 (UTC)

There is a problem with proof. You see, you focus too much on what happens over 100. If you are at 99, you jump up to 162. And then, if you drop below 100 again with your reasoning, you can come back later. So it is not clear if you ever get stuck under 100. So I think you should say we are stuck between 1 and 162 and leave it that way. What do you think?Oleg Alexandrov | talk 05:44, 29 Jan 2005 (UTC)
I disagree. The computer program proves (presumably; I haven't actually checked it) that every number 1 to 99 is either happy or goes to 4. And every number above 99 eventually goes into the range 1–99. So (I think) the proof as I modified it is still correct.
The interesting fact, which I was trying to get at in my edits, is that 99 is the last number that gets bigger, which is why it's "special" with respect to this process. 162 isn't special in that sense. If you're going to stop at 162, I think you might as well stop at 1000. But the extra analysis to get down to 99 reveals some interesting structure in the sequences. dbenbenn | talk 06:24, 29 Jan 2005 (UTC)
If you put it that way you are right. And emphasizing 99 is good too. What I got confused about was the following: I would have really liked to not even talk about what happens under 163 (over 100 versus under 100), as there things jump around quite a bit. For comparison, while once we are in 1 to 163, we are dead stuck there. Your proof was not wrong, I misread it expecting something else. Oleg Alexandrov | talk 16:36, 29 Jan 2005 (UTC)

Checking up to 163

The following program in MATLAB, by User:Oleg Alexandrov, can be used to check the claim in the article about 1 to 163:

% Find the happy numbers, and the cycles which do not lead to happy numbers.
% Assume that we start at some integer between 1 and 163.
% It can be proved that the sequence t_0, t_1, ... as in the article,
% always stabilizes in this interval.

function main(m)

   A=zeros(163, 20); % row i will store the cyclical sequence starting at i
   
   for i=1:163
      N=i; % current term
      for j=1:20 % can prove that at most 18 iterations are necessary to start repeating the cycle
	 A(i, j)=N;
	 N=sum_digits(N);
      end
      
      if  (N ~= 1 & N ~= 4  & N~= 16  & N ~=  37 & N ~=    58 & N ~=    89 & N ~=   145   & N ~=  42   & N ~=  20   & N ~=   4)
	 disp('We have a problem! We neither got a happy number nor are we');
	 disp('in the cycle 4    16    37    58    89   145    42    20     4 ');
      end
   end

   
   A(1:163, 1:20) % display a table showing in each row the with all the cycles (please ignore the trailing zeros)

function sum=sum_digits(m)

   sum=0;
   p=floor(log(m)/log(10)+0.1)+1; % number of digits
   for i=1:p
      d=rem(m, 10);
      sum=sum+d^2;
      m=(m-d)/10;
   end

Dear dbenbenn, I took so much of your time. I am flattered. Thanks. Oleg Alexandrov | talk 00:45, 29 Jan 2005 (UTC)

That's what Wikipedia's all about. Thanks for explaining it to me, and I'm sorry I misunderstood at first. dbenbenn | talk 03:17, 29 Jan 2005 (UTC)
Could anyone mind telling what programming language the above code is made in? --213.89.179.53 (talk) 14:43, 3 August 2009 (UTC)[reply]
I checked the page history and the edit summary [1] says MATLAB. PrimeHunter (talk) 15:38, 3 August 2009 (UTC)[reply]
O_o knew I had forgotten to look somewhere... anyway, tnx, and I added the info about MATLAB to the source-codes header. --213.89.179.53 (talk) 18:33, 3 August 2009 (UTC)[reply]

Checking up to "anywhere"

The following tiny C program checks up to "any" number (< MAXINT), which can be given as optional argument (default=99), to see that no number gives an infinite loop, but always ends up at 1 (happy) or 4 (unhappy)).

It prints a message "xxx is (un)happy" for each number, unless an additional second argument is given (e.g. "silent"), in which case only the currently checked number is displayed (without linefeed).

In view of the highly non-optimized code (KISS principle), it takes about 20 sec on my PC to check up to 107 (ten million) (but maybe most time is spent in printf calls).

/* happy.c */

 sum(int i){ /* (recursively) calculate sum of squares of digits */
  return(( i<10 ) ? i*i : sum( i/10 ) + sum( i % 10 ));
 }

 happy(int i){ /* count iterations needed to reach 1 or 4 */
  int c=1;
  for ( ; i > 1; c++ ) if ( i==4 ) return( -c ); else i = sum(i);
  return( c );
 }

 main(int c,char**v){
  int i, h, max = ( c>1 ? atoi( v[1] ) : 99);
  for( i=1; i<=max; i++ ){
   printf( "%15d\r", i); h = happy(i);
   if( c<3 ) printf( "\t\t is found to be %s after %d iterations.\n",
               (h>0 ? "happy":"unhappy"), abs(h)-1 );
  }
 }

Enjoy... — MFH 23:34, 9 Mar 2005 (UTC)

A thought about proofs using computers

The proof on the main page has some quite developed (and interesting) reasoning concerning numbers below 1000, and terminates by "a computer program can easily verify that in the range 1 to 99...". Now,

  • first, the computer program checks as easily (in less than a millisecond) up to 999, thus making the longest part of the proof superfluous. (Understand me well, I find this part nevertheless most interesting!)
  • secondly, it cannot be checked by reading the proof whether this statement (about 1..99) is true or false. In order to have a "complete" proof, one would need the explicit list of the sequences for the remaining numbers (where the sequences could be truncated whenever a number less than the "starting point" is attained).

Of course, for the latter (explicitly displayed list) the difference between 99 and 999 is crucial. Thus, in some sense, the "lack" or "necessity" of what is missing in the end (in order to have a complete proof) justifies what is (without it) "superfluous" at the beginning. Quite remarkable! MFH: Talk 17:20, 29 September 2005 (UTC)[reply]

unhappy 42

I made a program that prints the sequences obtained for the numbers 1..99, but only up to the point where a number less than its predecessor is obtained (i.e. the point from which on the sequence is no more increasing). I noticed that most often this point was the number 42. More precisely, I counted for each number how many times it plays the role of such a "breakpoint" (for 1..99). Here are the results:

   1: 5.    2: 1.    4: 1.    5: 2.    8: 1.    9: 1.   10: 7.   11: 2.   13: 2.   16: 3.   17: 1.
  18: 1.   20: 2.   25: 5.   26: 1.   29: 2.   32: 1.   34: 3.   36: 1.   37: 4.   40: 1.   41: 5.
 42: 14.   45: 1.   49: 1.   50: 2.   51: 2.   52: 2.   53: 2.   58: 2.   61: 3.   64: 2.   65: 5.
  68: 2.   69: 1.   73: 1.   74: 1.   80: 1.   81: 2.   82: 1.   85: 1.   90: 1.    All others: 0.

I.e., while 42 is the breakpoint for 14 numbers, all other numbers are breakpoints for at most 7 numbers.

Of course this result is related to the choice of the first 100 numbers, but I don't think this is very important. (In fact, 42 remains the favourite taking into account all numbers up to 999, but the distribution becomes more homogenious for the others.) Strange, this 42.... MFH: Talk 22:21, 29 September 2005 (UTC)[reply]

It's the meaning of life :-) --HappyCamper 02:42, 5 November 2005 (UTC)[reply]
I wonder if that's why they chose to reference these numbers in the Doctor Who episode "42"? :-) 81.178.232.81 15:52, 20 May 2007 (UTC)[reply]
All unhappy numbers go into the loop 4, 16, 37, 58, 89, 145, 42, 20. What you're observing is that, for the eighty unhappy numbers from 2 to 99, fourteen of them enter the loop at one of 4, 16, 37, 58, 89, or 145 without first decreasing (4, 16, 37, 58, and 89 themselves plus 2, 5, 11, 16, 25, 29, 77, 85, and 98). Once in the loop, they decrease first when going from 145 to 42. The only unhappy number, of the first eighty (in the range 2 to 99) that enters the loop at 42 is 42 itself. Taking the first million unhappy numbers, less than 1% of them enter the loop at the number 42, at the lowest rate among the eight in the loop (the number 89 claims over 46%; the number 20 competes with 42 for least frequent at under 1.8%). Of course, 42 is thus an interesting unhappy number (and unique in its place in the "miserable" loop), but for slightly different reasons. --Peter Kirby (talk) 08:06, 31 May 2008 (UTC)[reply]

History?

So who first defined happy numbers? How did they come up with the name? What significance (if any) has the research of happy numbers had?--AlexSpurling 20:21, 5 October 2006 (UTC)[reply]

According to Unsolved problems in Nymber Theory by Richard Guy, Reg. Allenby's daughter thought of them. They have little significance, just are interesting. Bubba73 (talk), 21:05, 5 October 2006 (UTC)[reply]
Can you add that to the article, with the reference? (I don't have the book) That's an interesting tidbit. - DavidWBrooks 15:09, 6 October 2006 (UTC)[reply]
done. I wish I knew her actual name though. Bubba73 (talk), 15:25, 6 October 2006 (UTC)[reply]

unhappy 23

23 is NOT happy: 23²=529
5²+2²+9²=110
1²+1²+0²=2
2²=4
4²=16
1²+6²=37
3²+7²=58
5²+8²=89
8²+9²=145
1²+4²+5²=42
4²+2²=20
2²+0²=4
Please feedback if i'm wrong or not!!! *********** (March 30, 2007)

Wrong. 23 -> 2²+3² = 13, not 23². Sum of the square of the digits. Bubba73 (talk), 14:54, 30 March 2007 (UTC)[reply]
Sorry!

Trivia

Note: this conversation has been moved from the editors' Talk pages, to bring it to wider attention. It concerns a Dr. Who episode mention and whether it belongs in the article. - DavidWBrooks 21:37, 20 May 2007 (UTC)[reply]

Hi. I've taken the Doctor Who reference back out of the Happy number article. Wikipedia's trivia policy explicitly mentions "popular culture" sections as a prime example of what not to do in an article. It's very cool that happy numbers got mentioned on Doctor Who, I agree, but it's a fact about a Doctor Who episode, really - it doesn't help anyone who came to Wikipedia to find out about happy numbers. --HughCharlesParker (talk - contribs) 19:15, 20 May 2007 (UTC)[reply]

True, but you're overlooking another sector of readership: those who didn't come to wikipedia to find out about happy numbers, who probably don't know they exist, but who encounter them via a Dr. Who search - and therefore learn about them. Which is exactly why the reference should be in the article. If there were lots of such references then you wouldn't want them - e.g., you wouldn't include every TV-show reference to "pi" - but this is so unusual and unexpected that it's just the kind of thing wikipedia does well. Over-literal trivia-stomping in this case cuts off a route of spreading a little recreational mathematics to a world that needs all the math help it can get. - DavidWBrooks 19:24, 20 May 2007 (UTC)[reply]
Hi again. I've moved the conversation here to keep it together. You're right about people coming to the article because of the Doctor Who episode - that's why I read it. People like me, though, who came to it that way, already know it was in the doctor who episode. I'm not sure what you mean about people who didn't come to wikipedia to find out about happy numbers - if you didn't want to find out about them, why would you be reading the article? I think I must have misunderstood you - what have I missed? --HughCharlesParker (talk - contribs) 19:54, 20 May 2007 (UTC)[reply]
PS - I don't think I've pointed you to the most helpful policy page Handling Trivia is more helpful. The paragraph about pink-eye and Mir sums up what I'm on about. --HughCharlesParker (talk - contribs) 19:58, 20 May 2007 (UTC)[reply]
Here's what I have clumsily tried to convey: "trivia" mentions are an entry into many serious articles that might draw in people and enlarge their knowledge. A Dr. Who fan might stumble on this article, be intrigued about Happy Numbers, learn more about them, become a mathematician and solve all of Hilbert's Problems! OK, maybe that's a stretch ... but I love serendipity and think it should be encouraged, even if it litters some articles. - DavidWBrooks 21:37, 20 May 2007 (UTC)[reply]
I think it definitely merits some mention in this article - one or two sentences, at least. I'm not sure about having much more than that, but a lot of articles have a section "XYZ in popular culture", etc. There definitely should be some mention about it here. Bubba73 (talk), 23:22, 20 May 2007 (UTC)[reply]
I certainly think it's worth mentioning. Instead of a popular culture section which had one entry (and might never get a second), I have placed it in the tiny happy prime section where it belongs naturally in agreement with WP:TRIVIA. Note also that WP:TRIVIA is not policy but a guideline. And WP:HTRIV is neither; it's an essay. I don't think the paragraph there about pink-eye and Mir is a good analogy to happy numbers. Mir is an extremely notable topic with huge amounts of notable information "competing" for space. Happy numbers are a rather obscure topic which have a small article and may never have been mentioned in popular culture until they suddenly got this high-profile reference which probably greatly increases the number of people who have ever heard about happy primes. By the way, I did not know about the Doctor Who reference until an editor inserted mention in Happy number which I watch, and I enjoyed hearing about it. I look forward to see the episode when it airs on a channel I can see. PrimeHunter 23:51, 20 May 2007 (UTC)[reply]
I think the line about Dr. Who is hard to see in the article. If it shouldn't go in its own section, then I suggest making it a subsection of Happy Primes, so it appears in the table of contents and is set apart a little from the rest of the text. Bubba73 (talk), 00:25, 21 May 2007 (UTC)[reply]
The happy primes section is only five lines and the only place primes are mentioned. I don't think the last two lines should be the only subsection in the article, and I don't think it's necessary to show this reference in the table of contents. PrimeHunter 00:53, 21 May 2007 (UTC)[reply]
Bubba73: you're right, a lot of articles have a section "XYZ in popular culture" - but they shouldn't. Check out what wikipedia isn't and the trivia guideline. An increasing number of the "popular culture" sections have the trivia template at the top. --HughCharlesParker (talk - contribs) 18:18, 21 May 2007 (UTC)[reply]
Not everybody agres with this point of view, however; it's a guideline not a requirement. Many (most?) "pop culture" sections or their equivalent are, indeed, pointless collections of distracting fancruft. But not all. The template shouldn't be indiscriminatly slapped down on every section. - DavidWBrooks 19:27, 21 May 2007 (UTC)[reply]
It is so unusual for something like this to be mentioned (other than in the TV show Numb3rs), that I think it should certainly be in this article. I've known about happy numbers 20 years or so, and I think they are fairly well known in math circles. Bubba73 (talk), 19:45, 21 May 2007 (UTC)[reply]
:) Happy numbers: As Seen On TV!! Oh well. I guess this isn't going to bring down the project. --HughCharlesParker (talk - contribs) 19:48, 21 May 2007 (UTC)[reply]
Currently it is only one sentence. i think there is a consensus to let it stand as it is, right? Bubba73 (talk), 19:51, 21 May 2007 (UTC)[reply]
If we'd reached a consensus we'd all agree. I'm not agreeing (would Encyclopedia Brittanica include this line? Why not?) - I'm giving up. I just don't think that one short sentence is worth the effort when wikipedia is, as you point out, riddled with trivia. --HughCharlesParker (talk - contribs) 20:02, 21 May 2007 (UTC)[reply]
Wikipedia:Consensus says "Consensus does not mean that everyone agrees with the outcome; instead, it means that everyone agrees to abide by the outcome." It certainly looks like we have reached consensus with this short mention in the happy prime section and no trivia-like section. PrimeHunter 20:41, 21 May 2007 (UTC)[reply]

(unindent) I'm sorry, I misinterpreted your comments. We've written dozens of sentences about whether or not one sentence should remain. There is no "trivia" section now. Someone added a link to it in the article about Dr. Who episode. Bubba73 (talk), 20:32, 21 May 2007 (UTC)[reply]

I've just noticed this 18-month-old conversation after removing what I considered to be trivia from the article, and then saw it re-instated. I won't remove it again, although I still consider it to be trivia, not only in terms of the article's subject but also in terms of Doctor Who. I have some problems with the arguments above: if a DW fan were to stumble on the article, it would either be (a) through knowing that there is a reference in the series (third season?), (b) by accident or (c) by hearing about it some other way. In none of those cases does it help that user to appreciate happy numbers (or primes) or to know more about the subject. The serendipitous link would be from Doctor Who to happy number, meaning the link backwards is unnecessary (unless you want happy number fans to serendipitously find out about Doctor Who!)! Also, "in popular culture" should (IMO) really reflect instances where an article's subject is actually been notable in popular culture rather than as a trivial quiz question in a drama series! But "I guess this isn't going to bring down the project" as someone else said above... Stephenb (Talk) 15:58, 7 October 2008 (UTC)[reply]

I'm going to scum up this conversation by mentioning that this has got to be the most high-profile mention of happy numbers ever. That sounds like notability to me. 129.237.90.25 (talk) 02:58, 24 March 2009 (UTC)[reply]

definition issue

User:UKPhoenix79 seems to be taking issue with the definition (the first sentence of the article). I think it is clear: the process ends in 1, or in an infinite loop; those numbers that end in 1 are happy, other numbers are not. User:UKPhoenix79 has twice removed the correct explanation of the process. I would like User:UKPhoenix79 to explain any intended changes here before making any further changes, so we can fix this problem. Others are welcome to chime in, of course. -- Doctormatt 23:42, 21 May 2007 (UTC)[reply]

Perhaps the confusion comes in because if you continued the process on 1, it would be an infinite loop to itself. However, the definition states that you stop the stop the process once you hit 1. Maybe it would be clearer if it stated that the infinite loop doesn't include 1. Bubba73 (talk), 23:50, 21 May 2007 (UTC)[reply]
Yes, I think that certainly doesn't help. Would anyone mind if I broke the first sentence into a couple of sentences, so the iterative process is clearly defined first, and then happy numbers are defined based on that? Something like this:
Starting with any positive whole number, the following process can be applied: replace the number by the sum of the squares its digits, and repeat until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers and those that do not are unhappy numbers.
How does that sound? Doctormatt 00:07, 22 May 2007 (UTC)[reply]
I think that is good and makes it clearer, except I'd probably say that the process stops or terminates if you reach 1. Or you could state it that it goes to an infinite loop on 1 if it is happy, and an infinite loop not including 1 is not happy. Bubba73 (talk), 00:52, 22 May 2007 (UTC)[reply]

Mathematical Proof of fallacy of current statement on Happy Numbers

Take the sum of the squares of its digits continue iterating this process until it yields 1, or produces an infinite loop.

According to this statement a number is happy once it produces reduces to a 1 or produces an infinite loop. If that is so and making the assumption that the current sentence is correct we will prove that this statement is incorrect this by testing two known unhappy numbers and check the results.

Lets try 2
2² = 4 ← infinite loop start
4² = 16
1² + 6² = 37
3² + 7² = 58
5² + 8² = 89
8² + 9² = 145
1² + 4² + 5² = 42
4² + 2² = 20
2² + 0² = 4 ← infinite loop end

Lets Try 1979
1² + 9² + 7² + 9² = 212
2² + 1² + 2² = 9
9² = 81
8² + 1² = 65
6² + 5² = 61
6² + 1² = 37 ← infinite loop start
3² + 7² = 58
5² + 8² = 89
8² + 9² = 145
1² + 4² + 5² = 42
4² + 2² = 20
2² + 0² = 4
2² = 4
4² = 16
1² + 6² = 37 ← infinite loop end

Note that neither number is listed as a happy number here and in fact the smallest happy number aside from 1 is 7. This statement is then false and needs to be corrected. As it is blatantly false as it currently stands and actually stating (unintentionally) that EVERY number is happy. Actually an infinite loop is what defines an unhappy number. -- UKPhoenix79 08:08, 22 May 2007 (UTC)[reply]

Your initial quote omitted the first sentence which is what defined happy numbers in the article. What the article really said before each of your 3 changes [2][3][4] was:
A happy number is any number that eventually reduces to 1 when the following process is used: take the sum of the squares of its digits, and continue iterating this process until it yields 1, or produces an infinite loop. Numbers that are not happy are called unhappy numbers. [5]
I haven't seen anybody claim that you get a happy number if the process gives an infinite loop. Hopefully you will not revert the new extended definition which looks fine to me. PrimeHunter 17:21, 22 May 2007 (UTC)[reply]
I can see how that original statment can be ambiguous. Bubba73 (talk), 18:26, 22 May 2007 (UTC)[reply]

Question

I've heard a few names for the numbers 4, 16, 37, 58, 89, 145, 42, and 20. The most common being "miserable numbers". I can't find any source for these numbers have a special name as they relate to the whole Happy number thing. Has anyone else seen a source that has these numbers named specifically?

This is all I know. Bubba73 (talk), 02:26, 15 June 2007 (UTC)[reply]

base 16?

Sorry, but it seems to me that base 16 (AKA "hex") _does_ have a number less than 16 ("10" in hex); in hex: 2 -> 4 -> 10 -> 1 : done.

So base 16 should not be on the list of "the first few such are...", right?

Maybe someone should check that whole list.

- Abe —Preceding unsigned comment added by 66.114.69.71 (talkcontribs)

Thanks for pointing this out. I removed the sentence as it is uncited, appears to be OR, and best of all, is incorrect. Doctormatt 07:48, 20 July 2007 (UTC)[reply]

Is there a point to this?

Does this concept have any practical applications? I'm no mathematician, and I wonder about the point of it all. __meco (talk) 23:12, 19 February 2008 (UTC)[reply]

There are no practical applications (unless you are trying to unlock a sealed door on a spaceship falling into a star, and somebody chose a type of happy numbers as door code). Note that the bottom of the article shows it is in Category:Recreational mathematics. You can read about that in recreational mathematics. Some people enjoy such things (me for example). It's not relevant to Wikipedia whether something has practical applications. It matters whether it satisfies things like Wikipedia:Notability. PrimeHunter (talk) 23:32, 19 February 2008 (UTC)[reply]
I can see that it can be a useful preoccupation in the pursuit of heightened numeracy. In fact, when I was going to sleep last night I was playing with a few numbers (13,11,12,10) to see how they fared in this respect.
Also, I considered the existence of practical applications in a general perspective, and I came to the conclusion that such must exist, even though they have yet not been discovered (and I could present proof involving interference patterns, God, his angels and the tasks at hand in the Kingdom of God, but I shall abstain here).
But is there any reason not to consider number series based on cubed instead of squared digits, or factorializing the digits (or some other operation which may exist beyond my awareness) for such pursuits? __meco (talk) 09:20, 20 February 2008 (UTC)[reply]
There is often no good reason to choose certain rules like those for happy numbers. See OEIS:A035504 for the similar but less notable sequence with cubes. Squares are "simpler" than cubes and simplicity is often preferred by those inventing and studying recreational sequences. A large number of integer sequences based on the digits of a number have been studied for recreational purposes. If a sequence satisfies Wikipedia:Notability then Wikipedia may have an article about it, for example in Category:Base-dependent integer sequences. Other bases than 10 are sometimes studied. In more serious mathematics there is nothing special about base 10, but it's the base humans are used to and usually preferred in recreational mathematics. —Preceding unsigned comment added by PrimeHunter (talkcontribs) 23:01, 20 February 2008 (UTC)[reply]

Happy bases

To what point have bases been checked for happiness? I have no expertise on this subject, so I was hoping that someone could find this out and put a statement about it in the article. 128.12.41.37 (talk) 00:32, 24 July 2008 (UTC)[reply]

We definitely need a WP:Reliable source for the happy base stuff. Bubba73 (talk), 23:43, 12 November 2008 (UTC)[reply]
The first sentence on happy numbers in other bases is a little confusing to me: "The definition of happy numbers depends on the decimal (i.e., base 10) representation of the numbers. The definition can be extended to other bases." To me (I'm not a native speaker of english, though, nor very adept at math) this sounds as if the definition of a happy number is really only valid in the decimal system - is that the case? I don't see any reason why it should be, as the process of finding a happy number is really the same in any base (though the results for any given number vary). I would have said that "The definition of happy numbers depends on the numbering system employed" or something like that? Or, now that I think about it, maybe the fact that in other bases there may be several different unhappy loops or numbers that loop back on themselves makes another definition necessary after all?
If you say "happy number" without saying the base, it is assumed to be base 10. You can define the same type of numbers in other bases ("happy numbers in base X") but you get a different set of numbers that are happy in that base. Bubba73 You talkin' to me? 16:31, 10 March 2011 (UTC)[reply]
The lead doesn't mention the base but in practice it assumes base 10 and only defines one set of happy numbers: Those with base-10 representation 1, 7, 10, 13, 19, 23, 28, 31, .... Generally, if you say "digits" without saying a base, it is assumed to be base 10. The lead definition says "Starting with any positive integer, replace the number by the sum of the squares of its digits". This is generally considered equivalent to "Starting with any positive integer, replace the number by the sum of the squares of the digits in the base 10 representation of the number". Given the lead definition we could for example say "the number of days in January is a happy number" without writing the number at all or specifying how we normally prefer to write it. Later we have to explicitly mention other bases in order to extend the definition. PrimeHunter (talk) 17:01, 10 March 2011 (UTC)[reply]
Hm, OK. Does anyone know if there is any base that has no happy numbers besides the obvious 1,10,100 etc.?

'a sun'?????????

The article says, 'In the Docter Who episode "42", a sequence of happy primes (313, 331, 367, 379) is used as a code for unlocking a sealed door on a space ship about to collide with 'a sun'. Shouldn't it be 'the sun'? I don't watch Doctor Who or anything so I haven't changed anything yet but 'a sun' just doesn't make sense. The term 'sun' is usually only used to refer to the star our 8 planets revolve around, so if it were some other star, (and the nearest star is light years away) it wouldn't really matter to them. Unless there were some weird aliens living on a planet orbiting that star that they wanted to save. And if that were true in the show, then the article should at least say that! Also, i think that the subsection 'Use in popular (whatever the subsection which that sentence was in, because I forgot) shouldn't even be there. It's just one sentence... it doesn't matter. It should be moved to the article about Doctor Who, if there is one. —Preceding unsigned comment added by Fffgg (talkcontribs) 21:19, 8 May 2009 (UTC)[reply]

No, the second definition of "sun" is "A star that is the center of a planetary system". Bubba73 (talk), 00:22, 9 May 2009 (UTC)[reply]
It's called a sun in the episode.[6] It's a A living organism and not a normal star so we shouldn't change the term they chose (I don't know know whether the episode ever calls it a star). PrimeHunter (talk) 01:24, 9 May 2009 (UTC)[reply]
They don't call it a star, but they do call it a sun, in the episode.--213.89.179.53 (talk) 14:56, 3 August 2009 (UTC)[reply]

Cubes?

What happens if you do the happy number with cubes? Biquadrates? nth powers? Professor M. Fiendish, Esq. 13:00, 25 August 2009 (UTC)[reply]

Cubes give oeis:A035504. I don't know whether there are any OEIS sequences for higher powers. My computation says biquadrates (4th powers) give:
1, 10, 100, 1000, 10000, 11123, 11132, 11213, 11231, 11312, 11321, 12113, 12131, 12311, 13112, 13121, 13211, 21113, 21131, 21311, 23111, 31112, 31121, 31211, 32111, 44688, 44868, ...
Unsolved Problems in Number Theory has mention of powers above 2. See [7]. PrimeHunter (talk) 15:58, 25 August 2009 (UTC)[reply]

Origin

The section on the origin of happy numbers doesn't make sense. I don't have access to the reference, but the way the section is worded, it's unclear whether Reg Allenby is creditted with the concept or whether its just an anecdote about an interaction between him and his daughter. If she learnt about them at school, I don't understand what his role in the origin is. Presumably someone else had already thought of it - the daughter's teacher, if nobody else. Then there is almost a throw away remark that they may have originated in Russia. It really doesn't make sense. Can someone who has access to the reference tidy up the section? Wikipeterproject (talk) 01:59, 14 February 2010 (UTC)[reply]

The way that paragraph says is pretty much what the Guy reference says.

"Reg Allenby's daughter came home from school in Britain with the concept of happy numbers. The problem may have originated in Russia."

Bubba73 (You talkin' to me?), 02:09, 14 February 2010 (UTC)[reply]
Hmmm. That's a bit ambiguous isn't it? It doesn't say anything about the origin except that it might be from Russia. Reading the quote logically, the school was teaching the concept, the daughter told her dad about it...and...? What did Allenby do with it? The only thing that's clear about the origin is that it's not Allenby (he got it from his daughter) and not the daughter (she got it from school). I don't see the point of including the first part of the quote at all, really. Wikipeterproject (talk) 02:16, 14 February 2010 (UTC)[reply]
Well that is all that is known about the origin. Reg Allenby may have done some research. He is mentioned again in the reference. At least he must have brought it to the attention of the math community. I doubt the school was teaching about happy numbers. The point is to tell what is known about the origin. Guy (or someone) must think that it may have originated in Russia. Bubba73 (You talkin' to me?), 02:25, 14 February 2010 (UTC)[reply]
Then "the problem may have originated in Russia" is what we can substantiate from the secondary source. The rest is unclear and, in my opinion, we'd be better to leave it out, unless we can find something else that clarifies it. A poor source doesn't have to lead to a bad encyclopedia!! Wikipeterproject (talk) 02:35, 14 February 2010 (UTC)[reply]
"may have originated in Russia" helps some, but it isn't definitive. We know that Allenby's daughter told him about it and he communicated it to the math community. I'm OK with the way it is, because that is what the reference says. Both Guy and Allenby can be contacted by email. Bubba73 (You talkin' to me?), 02:55, 14 February 2010 (UTC)[reply]
I don't want to make this a bigger issue than it is, but just because there is a source, doesn't mean we have to use it. If the source doesn't actually tell us anything, in my opinion it's better not to use it. Contacting either by e-mail would probably amount to original research. Wikipeterproject (talk) 10:34, 14 February 2010 (UTC)[reply]
The source does tell what is known about the origin. I think if that is taken out, people might wonder about the origin. Bubba73 (You talkin' to me?), 17:32, 14 February 2010 (UTC)[reply]
Yes, but even with it in, I am wondering about the origin! It really doesn't tell us much... Wikipeterproject (talk) 19:15, 14 February 2010 (UTC)[reply]
I did some work on happy numbers and refereed a paper about them for publication, but I don't know any more than the above. Bubba73 (You talkin' to me?), 22:54, 14 February 2010 (UTC)[reply]

Zeroless pandigital

The pandigital number article has this line:

Two of the zeroless pandigital Friedman numbers are: 123456789 = ((86 + 2 × 7)5 - 91) / 34, and 987654321 = (8 × (97 + 6/2)5 + 1) / 34.

which seems to invalidate the most recent edit of this Happy number article[8], which includes an edit note saying "A number can't be both zeroless and pandigital")

I know nothing about this topic, and await enlightened discussion! - DavidWBrooks (talk) 22:53, 1 December 2010 (UTC)[reply]

A pandigital number is one that has all digits, including zero. So a "zeroless pandigital number" must mean one that has all digits except zero, rather than being the interesection of the zeroless numbers and the pandigital numbers. And the pandigital number article confirms that. Bubba73 You talkin' to me? 01:50, 2 December 2010 (UTC)[reply]
So the last edit of this article was incorrect? - DavidWBrooks (talk) 02:07, 2 December 2010 (UTC)[reply]
Yes, because there is such a thing as a "zeroless pandigital number". Bubba73 You talkin' to me? 02:10, 2 December 2010 (UTC)[reply]