Ask your own question, for FREE!
Mathematics 8 Online
OpenStudy (anonymous):

can anybody explain what is amstrong number ?

OpenStudy (kc_kennylau):

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)

OpenStudy (isaiah.feynman):

@kc_kennylau I like that you said you got it from Wikipedia the free encyclopedia.

OpenStudy (anonymous):

ok thanks guys !

OpenStudy (anonymous):

is there a formula to generate these

OpenStudy (kc_kennylau):

@Isaiah.Feynman copyright is very important :)

OpenStudy (kc_kennylau):

@beccaboo022a no in my knowledge

OpenStudy (kc_kennylau):

@Nascent no problem :)

OpenStudy (anonymous):

i think so, we dont have a formula for generating pythagorean triples also i think a^2 = b^2+c^2

OpenStudy (anonymous):

pythagorean triples is theorem

OpenStudy (isaiah.feynman):

@kc_kennylau I know some guy who always copied solutions and posed like he knew them

OpenStudy (anonymous):

do u guys have any idea how to write an algorithm to check armstrong number ?

OpenStudy (kc_kennylau):

In which language?

OpenStudy (kc_kennylau):

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.

OpenStudy (anonymous):

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

OpenStudy (anonymous):

thats the pseudo code for checking armstrong number. if you have an algorithm for generating armstrong numbers let me know. im interested :)

OpenStudy (kc_kennylau):

@beccaboo022a basically you can check the numbers one by one lol

OpenStudy (anonymous):

thanks @beccaboo022a @kc

OpenStudy (anonymous):

@kc_kennylau

OpenStudy (anonymous):

lol thats bruteforce

OpenStudy (kc_kennylau):

@beccaboo022a who said you can't use bruteforce? :P

OpenStudy (kc_kennylau):

@Nascent no problem :)

OpenStudy (anonymous):

bruteforce is not fit to called an algorithm in my dictionary of definitions ;)

OpenStudy (kc_kennylau):

what do you mean, a pattern in armstrong #?

OpenStudy (anonymous):

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 ?

OpenStudy (kc_kennylau):

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.

OpenStudy (kc_kennylau):

http://screencast.com/t/fpv3mxE1lX

OpenStudy (kc_kennylau):

I didn't know it till now, and I find it absolutely amazing that the list is finite.

OpenStudy (anonymous):

hummm things are really amazing !

OpenStudy (kc_kennylau):

I also am aware of the huge gap between 9474 and 54748.

OpenStudy (kc_kennylau):

@Nascent yes indeed :)

OpenStudy (anonymous):

how can we display fibonacci's series ?

OpenStudy (kc_kennylau):

http://mathworld.wolfram.com/NarcissisticNumber.html Complete list of Armstrong # :)

OpenStudy (kc_kennylau):

what do you mean by display?

OpenStudy (anonymous):

i mean to write a program

OpenStudy (kc_kennylau):

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

OpenStudy (anonymous):

in C++

OpenStudy (kc_kennylau):

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

OpenStudy (kc_kennylau):

sorry I don't know C++, please convert it yourself

OpenStudy (kc_kennylau):

It's pseudocode's function to let any programmer understand what's going on

OpenStudy (anonymous):

ok !

OpenStudy (kc_kennylau):

:)

OpenStudy (anonymous):

i got it now !

OpenStudy (anonymous):

thank you once again @kc_kennylau

OpenStudy (kc_kennylau):

no problem at all :)

OpenStudy (anonymous):

@kc_kennylau can you explain more about that algorithm !

OpenStudy (kc_kennylau):

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

OpenStudy (anonymous):

not this one

OpenStudy (kc_kennylau):

which

OpenStudy (anonymous):

the another one one with armstrong

OpenStudy (kc_kennylau):

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.

OpenStudy (kc_kennylau):

got to go see you after an hour sorry :/

OpenStudy (kc_kennylau):

FYI, i=54748

OpenStudy (anonymous):

ok !

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!