can anybody explain what is amstrong number ?
For example, \[153=1^3+5^3+3^3\\ 370=3^3+7^3+0^3\\ 371=3^3+7^3+1^3\\ 407=4^3+0^3+7^3.\] (Copied form WIkipedia)
@kc_kennylau I like that you said you got it from Wikipedia the free encyclopedia.
ok thanks guys !
is there a formula to generate these
@Isaiah.Feynman copyright is very important :)
@beccaboo022a no in my knowledge
@Nascent no problem :)
i think so, we dont have a formula for generating pythagorean triples also i think a^2 = b^2+c^2
pythagorean triples is theorem
@kc_kennylau I know some guy who always copied solutions and posed like he knew them
do u guys have any idea how to write an algorithm to check armstrong number ?
In which language?
Checking if an integer named \(i\) is an armstrong number: Let \(n\) be the number of digits of \(i\). Let \(\mbox{count}\) be an integer which is 0. From \(k\)=1 to \(k\)=\(n\): Add the nth power of the kth digit of \(n\) to \(\mbox{count}\). If \(\mbox{count}\)=\(i\): Say yes. Otherwise: Say no.
digits <= split(number) sum_of_cubes <= 0 WHILE digits digit <= chop(digits) sum_of_cubes += digit ENDWHILE IF sum_of_cubes == number Display Yes, its an armstrong number ENDIF
thats the pseudo code for checking armstrong number. if you have an algorithm for generating armstrong numbers let me know. im interested :)
@beccaboo022a basically you can check the numbers one by one lol
thanks @beccaboo022a @kc
@kc_kennylau
lol thats bruteforce
@beccaboo022a who said you can't use bruteforce? :P
@Nascent no problem :)
bruteforce is not fit to called an algorithm in my dictionary of definitions ;)
what do you mean, a pattern in armstrong #?
like, we dont have a pattern for generating prime numbers why do mathematicians spend so much in trying for an algorithm to generate prime numbers ?
http://oeis.org/A005188 This is the list of some of the Armstrong numbers. Note that there is FINITELY many Armstrong number in a given base.
https://en.wikipedia.org/wiki/Narcissistic_number#Narcissistic_numbers_in_various_bases
I didn't know it till now, and I find it absolutely amazing that the list is finite.
hummm things are really amazing !
I also am aware of the huge gap between 9474 and 54748.
@Nascent yes indeed :)
how can we display fibonacci's series ?
http://mathworld.wolfram.com/NarcissisticNumber.html Complete list of Armstrong # :)
what do you mean by display?
i mean to write a program
Pseudocode: Let \(a\) be an integer which is 1. Let \(b\) be an integer which is 1. Let \(c\) be an undefined integer. Print \(a\). Print \(b\). Define \(c\) as \(a+b\). Loop forever: Print \(c\). Define \(a\) as \(b\). Define \(b\) as \(c\). Define \(c\) as \(a+b\).
in C++
Java: int a=1; int b=1; int c; System.out.println(a); System.out.println(b); c=a+b; while(true){ System.out.println(c); a=b; b=c; c=a+b; }
sorry I don't know C++, please convert it yourself
It's pseudocode's function to let any programmer understand what's going on
ok !
:)
i got it now !
thank you once again @kc_kennylau
no problem at all :)
@kc_kennylau can you explain more about that algorithm !
Fibonacci series is 1, 1, 2, 3, 5, 8, 13, ... Each term is generated by adding the last two terms together, i.e.: 1+1=2 1+2=3 2+3=5 3+5=8 5+8=13
not this one
which
the another one one with armstrong
So, let's look at the number \(\color{green}{54748}\). It has 5 digits. (n=\(\color{red}5\)) count=\(\color{green}5^{\color{red}5}+\color{green}4^{\color{red}5}+\color{green}7^{\color{red}5}+\color{green}4^{\color{red}5}+\color{green}8^{\color{red}5}\) Then we check if count equals 54748.
got to go see you after an hour sorry :/
FYI, i=54748
ok !
Join our real-time social learning platform and learn together with your friends!