Jump to content

Sum of square and cube digits of an integer are primes: Difference between revisions

Add FOCAL
(→‎{{header|ALGOL 68}}: Use a more sensible sieve size)
(Add FOCAL)
Line 185:
16 17 25 28 34 37 47 52 64
</pre>
 
=={{header|FOCAL}}==
<lang focal>01.10 F I=1,100;D 2
01.20 Q
 
02.10 F P=2,3;S N=I^P;D 3;D 4;I (C)2.3
02.20 T %2,I,!
02.30 R
 
03.10 S S=0
03.20 S M=FITR(N/10)
03.30 S S=S+(N-M*10)
03.40 S N=M
03.50 I (-N)3.2
 
04.10 S C=0
04.20 I (1-S)4.3;S C=-1;R
04.30 I (2-S)4.4;S C=0;R
04.40 F D=2,FSQT(S)+1;D 5;I (C)4.5
04.50 R
 
05.10 S Z=S/D
05.20 I (FITR(Z)-Z)5.3;S C=-1
05.30 R</lang>
{{out}}
<pre>= 16
= 17
= 25
= 28
= 34
= 37
= 47
= 52
= 64</pre>
 
=={{header|FreeBASIC}}==
2,114

edits

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