Jump to content

Narcissistic decimal number: Difference between revisions

m
→‎{{header|R}}: Syntax highlighting.
m (→‎{{header|Pascal}}: moved from Own_digits_power_sum)
m (→‎{{header|R}}: Syntax highlighting.)
Line 4,001:
===For loop solution===
This is a slow method and it needed above 5 minutes on a i3 machine.
<lang Rrsplus>for (u in 1:10000000) {
j <- nchar(u)
set2 <- c()
Line 4,047:
*As we are using format anyway, we take the chance to make the output look nicer.
 
<lang Rrsplus>generateArmstrong<-function(howMany)
{
resultCount<-i<-0
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.