Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
How can i do in prolog (0<=N<=10000), N not divisible by 2 or 5.
 
t :- for(X, 0, 10000, 1), tsub(X).
tsub(X) :- (X mod 2) =\= 0, (X mod 5) =\= 0, write(X), nl, fail.

?- t.
1
3
7
9
11
13
17
19
21
23
...

I'm using Amzi! Prolog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top