Padovan sequence: Difference between revisions

m
→‎{{header|ALGOL 68}}: Correct "off-by-one" comments
(→‎{{header|ALGOL 68}}: Compute and compare the correct number of terms of the sequences)
m (→‎{{header|ALGOL 68}}: Correct "off-by-one" comments)
Line 69:
=={{header|ALGOL 68}}==
<lang algol68>BEGIN # show members of the Padovan Sequence calculated in various ways #
# returns the first 0..n elements of the Padovan sequence by the #
# recurance relation: P(n)=P(n-2)+P(n-3) #
OP PADOVANI = ( INT n )[]INT:
Line 79:
p
END; # PADOVANI #
# returns the first 0..n elements of the Padovan sequence by #
# computing by truncation P(n)=floor(p^(n-1) / s + .5) #
# where s = 1.0453567932525329623 #
Line 95:
result
END; # PADOVANC #
# returns the first 0..n L System strings of the Padovan sequence #
OP PADOVANL = ( INT n )[]STRING:
BEGIN
3,026

edits