Motzkin numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|Quackery}}: tweaked prime)
m (→‎{{header|Quackery}}: linked to Primality by trial division)
Line 1,472: Line 1,472:
=={{header|Quackery}}==
=={{header|Quackery}}==


<code>sqrt</code> is defined at [[Isqrt (integer square root) of X#Quackery]].
<code>isprime</code> is defined at [[Primality by trial division#Quackery]].


<lang Quackery> [ dup 4 < iff [ 1 > ] done
<lang Quackery> ' [ 1 1 ]
dup 1 & not iff [ drop false ] done
true swap dup sqrt
0 = iff [ 2drop not ] done
1 >> times
[ dup i^ 1 << 3 + mod 0 = if
[ dip not conclude ] ]
drop ] is prime ( n --> b )

' [ 1 1 ]
41 times
41 times
[ dup -2 split nip do
[ dup -2 split nip do
Line 1,491: Line 1,482:
behead drop
behead drop
witheach
witheach
[ i^ echo sp dup echo prime if [ say " prime" ] cr ]</lang>
[ i^ echo sp dup echo isprime if [ say " prime" ] cr ]</lang>


{{out}}
{{out}}