|
|
Line 959: |
Line 959: |
|
912985153 |
|
912985153 |
|
</pre> |
|
</pre> |
|
|
|
|
⚫ |
|
|
|
|
|
⚫ |
You should have enough memory to avoid stack overflow and configure GP accordingly... |
|
|
|
|
⚫ |
<syntaxhighlight lang="parigp"> |
|
⚫ |
select(is_Armstrong(n)={n==vecsum([d^#n|d<-n=digits(n)])}, [100..999999999]) |
|
⚫ |
|
|
|
|
|
⚫ |
|
|
⚫ |
<pre>%1 = [153,370,371,407,1634,8208,9474,54748,92727,93084,548834,1741725,4210818,9800817,9926315, 24678050,24678051,88593477,146511208,472335975,534494836,912985153]</pre> |
|
|
|
|
|
=={{header|Pascal}}== |
|
=={{header|Pascal}}== |
Line 1,958: |
Line 1,969: |
|
912985153 |
|
912985153 |
|
</pre> |
|
</pre> |
|
|
|
⚫ |
|
|
|
|
|
⚫ |
You should have enough memory to avoid stack overflow and configure GP accordingly... |
|
|
|
|
⚫ |
<syntaxhighlight lang="parigp"> |
|
⚫ |
select(is_Armstrong(n)={n==vecsum([d^#n|d<-n=digits(n)])}, [100..999999999]) |
|
⚫ |
|
|
|
|
|
⚫ |
|
|
⚫ |
<pre>%1 = [153,370,371,407,1634,8208,9474,54748,92727,93084,548834,1741725,4210818,9800817,9926315, 24678050,24678051,88593477,146511208,472335975,534494836,912985153]</pre> |
|