Giuga numbers: Difference between revisions
→{{header|Euler}}: Sybntax highlight with Mediawiki markup
imported>Maxima enthusiast No edit summary |
(→{{header|Euler}}: Sybntax highlight with Mediawiki markup) |
||
Line 551:
=={{header|Euler}}==
Uses the C style for loop procedure from the [[Sieve of Eratosthenes]] task
'''begin'''▼
'''new''' for; '''new''' n; '''new''' gCount;▼
▲begin
for <- ` '''formal''' init; '''formal''' test; '''formal''' incr; '''formal''' body;
▲ new for; new n; new gCount;
again: '''if''' test '''then''' '''begin''' body; incr; '''goto''' again '''end''' '''else''' 0
gCount <-
for( ` n <- 2 ', ` gCount < 4 ', ` n <- n + 4 '
'''new''' v; '''new''' f; '''new''' isGiuga; '''new''' fCount;
for( ` f <- 3 ', ` f <= v '''and''' isGiuga ', ` f <- f + 2 '
'''end''' '''else'''
'''if''' isGiuga
'''if''' fCount >
'''end''' '''else'''
'''end''' $▼
▲end $
=={{header|Go}}==
|