32 lines
758 B
Text
32 lines
758 B
Text
#include <jambo.h>
|
|
|
|
#prototype isdeceptive(_X_)
|
|
#prototype modulepow(_X_,_Y_,_Z_)
|
|
#synon _isdeceptive Isdeceptive
|
|
#synon _modulepow ModulePow
|
|
#define Breaking Goto(exit)
|
|
Main
|
|
i = 49, c=0
|
|
Iterator ( ++i, #(c <> 10), \
|
|
Print only if ( Is deceptive 'i', Set 'i,"\n"'; ++c ) )
|
|
End
|
|
|
|
Subrutines
|
|
|
|
is deceptive ( n )
|
|
x=7
|
|
And( Bitand(n,1), And( Mod(n,3), Mod(n,5) )), do {
|
|
Iterator( x+=6, #( (x*x) <= n ),\
|
|
#(!( (n%x) && (n%(x+4)) )), do{ \
|
|
Module Pow (10, Minus one(n), n), Is equal to '1', Breaking } )
|
|
}
|
|
Set '0'
|
|
exit:
|
|
Return
|
|
|
|
module pow(b, e, m)
|
|
Loop for (p = 1, e, e >>= 1)
|
|
Bitand(e, 1), do{ #( p = (p * b) % m ) }
|
|
#( b = (b * b) % m )
|
|
Next
|
|
Return (p)
|