This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
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.
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
All numbers, and therefore all primes, of the form and are happy.
This original statement is incorrect for instances below 10 as follows.
note that these numbers yield values of either 12 + 02 + 02 + ... + 02 + 02 + 32 = 10 → 12 + 02 = 1
12 + 02 + 02 + ... + 02 + 02 + 92 = 82 → 82 + 22 = 68 → 62 + 82 = 100 → 12 + 02 + 02 = 1
12 + 02 + 02 + ... + 02 + 02 + 92 = 82 → 82 + 22 = 68 → 62 + 82 = 100 → 12 + 02 + 02 = 1
I removed the text:
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)
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)
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)
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)
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,
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)
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)
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)
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)
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)
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)
(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)
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)
Doctor Who brought me here. Never new about happy numbers until then.... Praise Him :) Andy_Howard ( talk) 03:42, 15 December 2011 (UTC)
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)
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
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)
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?
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 ( talk • contribs)
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)
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)
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 ( talk • contribs) 21:19, 8 May 2009 (UTC)
i know old comment but adding detail to it: the definition of star vs sun differs greatly but generally when dealing with any source of light in the sky it is a star (hence why venus is labeled the evening star unless dealing with the planet specifically), "a sun" is rarely used more often "our sun" or "the sun" is used but when dealing with any galactic system or within earths orbit of a star the termonology switches to sun. there is no scientific reason for the change but it is common across all forms of media and science fiction (star trek being a large offender for this) 152.91.9.153 ( talk) 01:07, 18 December 2012 (UTC)
What happens if you do the happy number with cubes? Biquadrates? nth powers? Professor M. Fiendish, Esq. 13:00, 25 August 2009 (UTC)
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)
"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)
The pandigital number article has this line:
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)
Citations are needed for the programs. Otherwise they are original research, not verifyable, and will have to be removed. Bubba73 You talkin' to me? 04:14, 18 April 2011 (UTC)
The article states that 392 is a happy number when in fact it creates an endless cycle on its 13th step.
392^2= 153664
1^2+5^2+3^2+6^2+6^2+4^2=123
1^2+2^2+3^2=14
1^2+4^2=17
1^2+7^2=50 (lets assume the rest of the numbers are squared)
5+0=25
2+5=29
2+9=85
8+5=89
8+9=145
1+4+5=42
4+2=20
2+0=4
4=16
1+6=37
3+7=58
5+8=89
8+9=145
etc etc...
— Preceding
unsigned comment added by
70.160.22.169 (
talk) 14:16, 18 July 2011 (UTC)
The article states that 986543210 is the largest happy number with no redundant digits, and this statement is flagged as needing a citation. I question the need for a citation in this case, since the statement can be verified by a few minutes of manual calculation. There are only seven larger numbers with no repeated digits: 987654321, 98765432, 98765431, 98765421, 98765321, 98764321, and 98754321. It is easy to verify that these seven numbers are unhappy, and that 986543210 is happy. David Radcliffe ( talk) 08:29, 1 October 2011 (UTC)
Stumbling over this issue at the policy village pump, I am less concerned about whether this is routine calculation or not but I wonder why this fact should be notable. If anybody would be interested in knowing the "largest happy number with no redundant digits" s/he can easily compute it her/himself. OTOH, if the fact truly is notable you should be able to find a reference. Nageh ( talk) 17:56, 4 October 2011 (UTC)
It's not that hard to check;
There is a discontinuity in content in the section "Overveiw".The text below is the most recent edition:
The happy numbers below 500 are:
1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, 103, 109, 129, 130, 133, 139, 167, 176, 188, 190, 192, 193, 203, 208, 219, 226, 230, 236, 239, 262, 263, 280, 291, 293, 301, 302, 310, 313, 319, 320, 326, 329, 331, 338, 356, 362, 365, 367, 368, 376, 379, 383, 386, 391, 392, 397, 404, 409, 440, 446, 464, 469, 478, 487, 490, 496 (sequence A007770 in OEIS). The happiness of a number is preserved by rearranging the digits, and by inserting or removing any number of zeros anywhere in the number.
The unique combinations of above (the rest are just rearrangements and/or insertions of zero digits):
1, 7, 13, 19, 23, 28, 44, 49, 68, 79, 129, 133, 139, 167, 188, 226, 236, 239, 338, 356, 367, 368, 379, 446, 469, 478, 556, 566, 888, 899.
The discontinuity is the first list of numbers are specified as "below 500" and the second list of numbers are supposed to be from the previous list. However, the last for numbers in the second set are larger than 500. I do not know how this is to be resolved, but the easiest edit would be to remove the last four numbers of the second list. Cjripper ( talk) 23:51, 9 February 2012 (UTC)
My removal of the citation-needed at the omitted proof by exhaustion has been reverted. I submit that such a small number of cases makes the inclusion of each calculation unnecessary, as there is no ambiguity about how to proceed.
For instance:
f(1) = 1
f(2) = 22 = 4
f(3) = 32 = 9. f(9) = 92 = 81. f(81) = 82 + 12 = 65. f(65) = 62 + 52 = 61. f(61) = 62 + 12 = 37. f(37) = 32 + 72 = 58. f(58) = 52 + 82 = 89. f(89) = 82 + 92 = 145. f(145) = 12 + 42 + 52 = 42. f(42) = 42 + 22 = 20. f(20) = 22 + 02 = 4.
and so forth.
Indeed, mathematics often asks the reader to fill in larger and less clear gaps. I cite:
Generating_set_of_a_group#Finitely_generated_group - last sentence.
Yoneda's_lemma#Proof - in particular "The proof in the contravariant case is completely analogous." Here, there are only two cases, yet one is omitted for the sake of space.
Enforcing a policy of walking a user through each logical step in a proof, regardless of ease, would make many, many proofs here very bloated. The only alternative would be to replace the newly-bloated proofs with links to external sources, making the articles less enlightening and more of a collection of theorems proven elsewhere. — Preceding unsigned comment added by 75.83.151.41 ( talk) 12:12, 5 May 2012 (UTC)
"7" is apparently a happy number...
7 squared is 49 ... 4+9 = 13 ... 1+3 = 4
4 squared is 16 ... 1+6 = 7
and round the loop we go.
I thought for it to be happy it had to collapse to "1"? Or is the infinite-loop condition also valid? The introduction suggests looping is "unhappy". Or maybe I should go get some lunch and come back to this?
If instead you're only supposed to do one round of adding per step, then it quickly runs into a different endless loop:
7 squared is 49 ... 4+9 = 13
13 squared is 169 ... 1+6+9 = 16
16 squared is 256 ... 2+5+6 = 13...
?!?!?
193.63.174.211 (
talk) 11:58, 9 May 2013 (UTC)
The section "Cubing the digits rather than squaring" appears to be original research; probably correct, certainly interesting, but without a reliable source it doesn't belong here. If I'm wrong - if this is something that is known and worked out/commented on elsewhere - then it needs a reference ... if I'm right, it needs to be removed. - DavidWBrooks ( talk) 15:25, 21 December 2013 (UTC)
Cyberbot II has detected that page contains external links that have either been globally or locally blacklisted. Links tend to be blacklisted because they have a history of being spammed, or are highly innappropriate for Wikipedia. This, however, doesn't necessarily mean it's spam, or not a good link. If the link is a good link, you may wish to request whitelisting by going to the request page for whitelisting. If you feel the link being caught by the blacklist is a false positive, or no longer needed on the blacklist, you may request the regex be removed or altered at the blacklist request page. If the link is blacklisted globally and you feel the above applies you may request to whitelist it using the before mentioned request page, or request its removal, or alteration, at the request page on meta. When requesting whitelisting, be sure to supply the link to be whitelisted and wrap the link in nowiki tags. The whitelisting process can take its time so once a request has been filled out, you may set the invisible parameter on the tag to true. Please be aware that the bot will replace removed tags, and will remove misplaced tags regularly.
Below is a list of links that were found on the main page:
\bmathsball\.blogspot\.com\.es
on the global blacklistIf you would like me to provide more information on the talk page, contact User:Cyberpower678 and ask him to program me with more info.
From your friendly hard working bot.— cyberbot II NotifyOnline 17:01, 22 December 2013 (UTC)
I've removed this text:
There is a very interesting recursive formula that allows you to check if number is happy after a number of iterations, this formula was developed by a mathematician Young native of Fresnillo Zacatecas Mexico named Jose de Jesus Camacho Medina, who recorded his formula in Online enciplopedia integer under the record: http://oeis.org/A007770.
because the "formula" is merely a restatement of the definition, replacing "sum of squares of digits" with an expression that extracts the kth digit, squares it, and sums on k. This adds nothing new, and I don't think we can consider it interesting in this context. Joule36e5 ( talk) 05:58, 27 August 2014 (UTC)
Dubious tag: The source does not mention that M42643801 is a happy number; a Google search does not indicate any connection between happy and Mersenne primes (not all Mersenne primes are happy: 127 is not). I can't find a source that indicates that M42643801 is happy, or that anyone has even checked if it is. Renerpho ( talk) 07:38, 29 December 2017 (UTC)
Is 0 happy or unhappy? — Preceding unsigned comment added by 2604:CB00:12F:B900:3047:2A48:5F65:52B3 ( talk) 02:05, 10 November 2021 (UTC)
I'm seeing two big blocks of red text which seem to indicate some kind of error rendering a math equation.
The first is in the header, right after "1^2 + 3^2 = 10, and" which says "Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server " http://localhost:6011/en.wikipedia.org/v1/":): {\displaystyle 1^2+0^2=1}"
The second error is in the "Happy numbers and perfect digital invariants" page, right after "Given the perfect digital invariant function", and it says "Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server " http://localhost:6011/en.wikipedia.org/v1/":): {\displaystyle F_{p, b}(n) = \sum_{i=0}^{\lfloor \log_{b}{n} \rfloor} {\left(\frac{n \bmod{b^{i+1}} - n \bmod{b^{i}}}{b^{i}}\right)}^p} ." Graxwell ( talk) 00:46, 27 September 2023 (UTC)
Now the problem has gone away for me. Bubba73 You talkin' to me? 02:54, 27 September 2023 (UTC)
This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
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.
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
All numbers, and therefore all primes, of the form and are happy.
This original statement is incorrect for instances below 10 as follows.
note that these numbers yield values of either 12 + 02 + 02 + ... + 02 + 02 + 32 = 10 → 12 + 02 = 1
12 + 02 + 02 + ... + 02 + 02 + 92 = 82 → 82 + 22 = 68 → 62 + 82 = 100 → 12 + 02 + 02 = 1
12 + 02 + 02 + ... + 02 + 02 + 92 = 82 → 82 + 22 = 68 → 62 + 82 = 100 → 12 + 02 + 02 = 1
I removed the text:
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)
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)
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)
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)
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,
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)
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)
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)
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)
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)
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)
(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)
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)
Doctor Who brought me here. Never new about happy numbers until then.... Praise Him :) Andy_Howard ( talk) 03:42, 15 December 2011 (UTC)
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)
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
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)
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?
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 ( talk • contribs)
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)
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)
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 ( talk • contribs) 21:19, 8 May 2009 (UTC)
i know old comment but adding detail to it: the definition of star vs sun differs greatly but generally when dealing with any source of light in the sky it is a star (hence why venus is labeled the evening star unless dealing with the planet specifically), "a sun" is rarely used more often "our sun" or "the sun" is used but when dealing with any galactic system or within earths orbit of a star the termonology switches to sun. there is no scientific reason for the change but it is common across all forms of media and science fiction (star trek being a large offender for this) 152.91.9.153 ( talk) 01:07, 18 December 2012 (UTC)
What happens if you do the happy number with cubes? Biquadrates? nth powers? Professor M. Fiendish, Esq. 13:00, 25 August 2009 (UTC)
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)
"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)
The pandigital number article has this line:
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)
Citations are needed for the programs. Otherwise they are original research, not verifyable, and will have to be removed. Bubba73 You talkin' to me? 04:14, 18 April 2011 (UTC)
The article states that 392 is a happy number when in fact it creates an endless cycle on its 13th step.
392^2= 153664
1^2+5^2+3^2+6^2+6^2+4^2=123
1^2+2^2+3^2=14
1^2+4^2=17
1^2+7^2=50 (lets assume the rest of the numbers are squared)
5+0=25
2+5=29
2+9=85
8+5=89
8+9=145
1+4+5=42
4+2=20
2+0=4
4=16
1+6=37
3+7=58
5+8=89
8+9=145
etc etc...
— Preceding
unsigned comment added by
70.160.22.169 (
talk) 14:16, 18 July 2011 (UTC)
The article states that 986543210 is the largest happy number with no redundant digits, and this statement is flagged as needing a citation. I question the need for a citation in this case, since the statement can be verified by a few minutes of manual calculation. There are only seven larger numbers with no repeated digits: 987654321, 98765432, 98765431, 98765421, 98765321, 98764321, and 98754321. It is easy to verify that these seven numbers are unhappy, and that 986543210 is happy. David Radcliffe ( talk) 08:29, 1 October 2011 (UTC)
Stumbling over this issue at the policy village pump, I am less concerned about whether this is routine calculation or not but I wonder why this fact should be notable. If anybody would be interested in knowing the "largest happy number with no redundant digits" s/he can easily compute it her/himself. OTOH, if the fact truly is notable you should be able to find a reference. Nageh ( talk) 17:56, 4 October 2011 (UTC)
It's not that hard to check;
There is a discontinuity in content in the section "Overveiw".The text below is the most recent edition:
The happy numbers below 500 are:
1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, 103, 109, 129, 130, 133, 139, 167, 176, 188, 190, 192, 193, 203, 208, 219, 226, 230, 236, 239, 262, 263, 280, 291, 293, 301, 302, 310, 313, 319, 320, 326, 329, 331, 338, 356, 362, 365, 367, 368, 376, 379, 383, 386, 391, 392, 397, 404, 409, 440, 446, 464, 469, 478, 487, 490, 496 (sequence A007770 in OEIS). The happiness of a number is preserved by rearranging the digits, and by inserting or removing any number of zeros anywhere in the number.
The unique combinations of above (the rest are just rearrangements and/or insertions of zero digits):
1, 7, 13, 19, 23, 28, 44, 49, 68, 79, 129, 133, 139, 167, 188, 226, 236, 239, 338, 356, 367, 368, 379, 446, 469, 478, 556, 566, 888, 899.
The discontinuity is the first list of numbers are specified as "below 500" and the second list of numbers are supposed to be from the previous list. However, the last for numbers in the second set are larger than 500. I do not know how this is to be resolved, but the easiest edit would be to remove the last four numbers of the second list. Cjripper ( talk) 23:51, 9 February 2012 (UTC)
My removal of the citation-needed at the omitted proof by exhaustion has been reverted. I submit that such a small number of cases makes the inclusion of each calculation unnecessary, as there is no ambiguity about how to proceed.
For instance:
f(1) = 1
f(2) = 22 = 4
f(3) = 32 = 9. f(9) = 92 = 81. f(81) = 82 + 12 = 65. f(65) = 62 + 52 = 61. f(61) = 62 + 12 = 37. f(37) = 32 + 72 = 58. f(58) = 52 + 82 = 89. f(89) = 82 + 92 = 145. f(145) = 12 + 42 + 52 = 42. f(42) = 42 + 22 = 20. f(20) = 22 + 02 = 4.
and so forth.
Indeed, mathematics often asks the reader to fill in larger and less clear gaps. I cite:
Generating_set_of_a_group#Finitely_generated_group - last sentence.
Yoneda's_lemma#Proof - in particular "The proof in the contravariant case is completely analogous." Here, there are only two cases, yet one is omitted for the sake of space.
Enforcing a policy of walking a user through each logical step in a proof, regardless of ease, would make many, many proofs here very bloated. The only alternative would be to replace the newly-bloated proofs with links to external sources, making the articles less enlightening and more of a collection of theorems proven elsewhere. — Preceding unsigned comment added by 75.83.151.41 ( talk) 12:12, 5 May 2012 (UTC)
"7" is apparently a happy number...
7 squared is 49 ... 4+9 = 13 ... 1+3 = 4
4 squared is 16 ... 1+6 = 7
and round the loop we go.
I thought for it to be happy it had to collapse to "1"? Or is the infinite-loop condition also valid? The introduction suggests looping is "unhappy". Or maybe I should go get some lunch and come back to this?
If instead you're only supposed to do one round of adding per step, then it quickly runs into a different endless loop:
7 squared is 49 ... 4+9 = 13
13 squared is 169 ... 1+6+9 = 16
16 squared is 256 ... 2+5+6 = 13...
?!?!?
193.63.174.211 (
talk) 11:58, 9 May 2013 (UTC)
The section "Cubing the digits rather than squaring" appears to be original research; probably correct, certainly interesting, but without a reliable source it doesn't belong here. If I'm wrong - if this is something that is known and worked out/commented on elsewhere - then it needs a reference ... if I'm right, it needs to be removed. - DavidWBrooks ( talk) 15:25, 21 December 2013 (UTC)
Cyberbot II has detected that page contains external links that have either been globally or locally blacklisted. Links tend to be blacklisted because they have a history of being spammed, or are highly innappropriate for Wikipedia. This, however, doesn't necessarily mean it's spam, or not a good link. If the link is a good link, you may wish to request whitelisting by going to the request page for whitelisting. If you feel the link being caught by the blacklist is a false positive, or no longer needed on the blacklist, you may request the regex be removed or altered at the blacklist request page. If the link is blacklisted globally and you feel the above applies you may request to whitelist it using the before mentioned request page, or request its removal, or alteration, at the request page on meta. When requesting whitelisting, be sure to supply the link to be whitelisted and wrap the link in nowiki tags. The whitelisting process can take its time so once a request has been filled out, you may set the invisible parameter on the tag to true. Please be aware that the bot will replace removed tags, and will remove misplaced tags regularly.
Below is a list of links that were found on the main page:
\bmathsball\.blogspot\.com\.es
on the global blacklistIf you would like me to provide more information on the talk page, contact User:Cyberpower678 and ask him to program me with more info.
From your friendly hard working bot.— cyberbot II NotifyOnline 17:01, 22 December 2013 (UTC)
I've removed this text:
There is a very interesting recursive formula that allows you to check if number is happy after a number of iterations, this formula was developed by a mathematician Young native of Fresnillo Zacatecas Mexico named Jose de Jesus Camacho Medina, who recorded his formula in Online enciplopedia integer under the record: http://oeis.org/A007770.
because the "formula" is merely a restatement of the definition, replacing "sum of squares of digits" with an expression that extracts the kth digit, squares it, and sums on k. This adds nothing new, and I don't think we can consider it interesting in this context. Joule36e5 ( talk) 05:58, 27 August 2014 (UTC)
Dubious tag: The source does not mention that M42643801 is a happy number; a Google search does not indicate any connection between happy and Mersenne primes (not all Mersenne primes are happy: 127 is not). I can't find a source that indicates that M42643801 is happy, or that anyone has even checked if it is. Renerpho ( talk) 07:38, 29 December 2017 (UTC)
Is 0 happy or unhappy? — Preceding unsigned comment added by 2604:CB00:12F:B900:3047:2A48:5F65:52B3 ( talk) 02:05, 10 November 2021 (UTC)
I'm seeing two big blocks of red text which seem to indicate some kind of error rendering a math equation.
The first is in the header, right after "1^2 + 3^2 = 10, and" which says "Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server " http://localhost:6011/en.wikipedia.org/v1/":): {\displaystyle 1^2+0^2=1}"
The second error is in the "Happy numbers and perfect digital invariants" page, right after "Given the perfect digital invariant function", and it says "Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server " http://localhost:6011/en.wikipedia.org/v1/":): {\displaystyle F_{p, b}(n) = \sum_{i=0}^{\lfloor \log_{b}{n} \rfloor} {\left(\frac{n \bmod{b^{i+1}} - n \bmod{b^{i}}}{b^{i}}\right)}^p} ." Graxwell ( talk) 00:46, 27 September 2023 (UTC)
Now the problem has gone away for me. Bubba73 You talkin' to me? 02:54, 27 September 2023 (UTC)