Sequences - Xref - Sequences - fibonacci


App: manual Page: fragments/sequences_1
PHP
HTML
fragments/sequences_1.pad
Result
<p>{sequence '1..8'}{$sequence} {/sequence}</p>
<p>{sequence fibonacci, rows=8}{$sequence} {/sequence}</p>
<p>{sequence prime, from=10, rows=6}{$sequence} {/sequence}</p>
<p>{sequence 'A..F'}{$sequence} {/sequence}</p>

App: manual Page: pages/sequences
PHP
HTML
pages/sequences.pad
Result
{meta title='Sequences'}

<p>The <code>{sequence}</code> tag generates values instead of reading them: a
range, a mathematical series, letters - 122 types, each iterated like any data
tag:</p>

{example 'fragments/sequences_1'}

<p>That is the smallest corner of a whole subsystem: plays that keep, remove or flag terms,
stores that pass a sequence from one tag to the next, actions that transform it, and random
draws with their own rules. It has an application of its own, which is its manual:</p>

<p><b><a href="{$padHost}sequence/">The sequence application</a></b> - every type, play,
action and option, demonstrated live.</p>
<h2>Seeing and hearing them</h2>

<p>A sequence is data like any other, so {tag 'chart'} and {tag 'sparkline'} draw it
straight away with <code>sequence=</code>:</p>

{example 'fragments/sequences_2'}

<p>The sequence application has three pages built on that: the
<a href="{$padHost}sequence/?gallery">Gallery</a> draws every type beside the OEIS entry its
terms come from, <a href="{$padHost}sequence/?listen">Listen</a> plays a sequence as notes -
Recamán's is the famous one - in an audio file written into the page, and
<a href="{$padHost}sequence/?guess">Guess</a> shows the start of a sequence and asks for the
next term.</p>

App: regression/errors Page: syntax/a_sequence_option_typo_is_reported
PHP
HTML
syntax/a_sequence_option_typo_is_reported.pad
Result
{make:fibonacci rowz=3}{$sequence},{/make:fibonacci}

App: regression/framework Page: expressions/and_it_is_a_value_so_it_takes_an_operator
PHP
HTML
expressions/and_it_is_a_value_so_it_takes_an_operator.pad
Result
{echo '' | sequence:fibonacci(8) + 1}

App: regression/framework Page: expressions/sequence_over_a_type_gives_the_nth_term
PHP
HTML
expressions/sequence_over_a_type_gives_the_nth_term.pad
Result
{echo '' | sequence:fibonacci(8)}

App: regression/framework Page: expressions/the_first_term_is_the_first_one_not_the_second
PHP
HTML
expressions/the_first_term_is_the_first_one_not_the_second.pad
Result
{echo '' | sequence:fibonacci(1)}

App: regression/framework Page: lenient/a_sequence_option_typo_is_ignored
PHP
lenient/a_sequence_option_typo_is_ignored.php
HTML
lenient/a_sequence_option_typo_is_ignored.pad
Result
<?php

// The lenient walk under test: with the syntax check off, what cannot be evaluated
// yields empty, what nothing claims stays as written, and the walk carries on.

$padCheckSyntax = FALSE;

?>
{make:fibonacci rowz=3}{$sequence},{/make:fibonacci}

App: regression/framework Page: prefixes/make_names_a_sequence_type_to_build
PHP
HTML
prefixes/make_names_a_sequence_type_to_build.pad
Result
{make:fibonacci rows=3}
{$sequence},
{/make:fibonacci}

App: regression/framework Page: sequence/a_count_or_range_given_to_a_type_without_a_parameter_is_read_as_such
PHP
HTML
sequence/a_count_or_range_given_to_a_type_without_a_parameter_is_read_as_such.pad
Result
[{prime 5}{$prime} {/prime}][{fibonacci 5}{$fibonacci} {/fibonacci}][{keep:prime '1..10'}{$sequence} {/keep:prime}][{flag:even '1;2;3'}{$sequence}{/flag:even}][{multiply 3, rows=3}{$multiply} {/multiply}][{repeat 'x', rows=2}{$repeat}{/repeat}]

App: regression/framework Page: sequence/a_lookup_goes_on_from_the_terms_kept
PHP
HTML
sequence/a_lookup_goes_on_from_the_terms_kept.pad
Result
[{echo sequence:amicable(2)}][{echo sequence:amicable(5)}][{echo sequence:amicable(3)}][{echo sequence:amicable(10)}][{echo sequence:happy(7)}][{echo sequence:happy(20)}][{echo sequence:happy(8)}][{echo sequence:happy(21)}][{echo sequence:fibonacci(40)}][{echo sequence:fibonacci(93)}][{echo sequence:fibonacci(7)}][{echo sequence:strong(3)}][{echo sequence:strong(1)}][{echo sequence:harshad(15)}][{echo sequence:harshad(16)}]

App: regression/framework Page: sequence/a_play_keeps_the_zero_term
PHP
HTML
sequence/a_play_keeps_the_zero_term.pad
Result
[{sequence fibonacci, rows=5, square}{$sequence} {/sequence}]

App: regression/framework Page: sequence/a_play_named_like_its_sequence_plays
PHP
HTML
sequence/a_play_named_like_its_sequence_plays.pad
Result
[{sequence square, make, square, rows=3}{$sequence} {/sequence}][{sequence fibonacci, rows=5, make, fibonacci}{$sequence} {/sequence}][{sequence square, rows=3}{$sequence} {/sequence}][{sequence square, rows=3, make='square'}{$sequence} {/sequence}][{sequence square, keep, square, rows=3}{$sequence} {/sequence}]

App: regression/framework Page: sequence/a_position_lookup_answers_the_same_whatever_was_asked_before
PHP
HTML
sequence/a_position_lookup_answers_the_same_whatever_was_asked_before.pad
Result
[{sequence '1..8'}{echo sequence:prime(9 - $sequence)} {/sequence}][{echo sequence:prime(3)} {echo sequence:prime(20)} {echo sequence:prime(2)}][{echo sequence:add(3, 10)} {echo sequence:add(3, 20)} {echo sequence:add(2)}][{sequence '1..3', push='s'}{/sequence}{echo sequence:add(2, 's')} {resume multiply=10}{echo sequence:add(2, 's')}][{echo sequence:fibonacci(10)} {echo sequence:fibonacci(5)} {echo sequence:lucas(5)}]

App: regression/framework Page: sequence/a_recurrence_keeps_its_history_under_a_filter
PHP
HTML
sequence/a_recurrence_keeps_its_history_under_a_filter.pad
Result
[{sequence fibonacci, rows=6, keep, even}{$sequence} {/sequence}]

App: regression/framework Page: sequence/a_recurrence_offers_the_positions_increment_names
PHP
HTML
sequence/a_recurrence_offers_the_positions_increment_names.pad
Result
[{sequence fibonacci, increment=2, rows=5}{$sequence} {/sequence}][{sequence lucas, increment=2, rows=4}{$sequence} {/sequence}][{sequence tribonacci, increment=3, from=2, rows=4}{$sequence} {/sequence}][{sequence fibonacci, from=5, skip=1, rows=3}{$sequence} {/sequence}][{sequence golomb, from=15000, rows=2}{$sequence} {/sequence}][{sequence fibonacci, from=5, try=2}{$sequence} {/sequence}][{sequence fibonacci, from=0, rows=3}{$sequence} {/sequence}][{sequence fibonacci, from=-3, increment=2, rows=3}{$sequence} {/sequence}][{sequence fibonacci, increment='1...3', rows=5, count}{$sequence}{/sequence}]