App: regression/framework Page: sequence/a_parameter_of_0_spelled_otherwise_is_read_as_0
PHP
|
HTML
sequence/a_parameter_of_0_spelled_otherwise_is_read_as_0.pad
|
Result
|
|
[{sequence modulo='0.0', rows=3}{$sequence} {/sequence}][{sequence modulo='-0', rows=3}{$sequence} {/sequence}][{sequence modulo='00', rows=3}{$sequence} {/sequence}][{sequence '1..3', make, modulo='0.0'}{$sequence} {/sequence}][{sequence ceil='0.0', rows=3}{$sequence} {/sequence}][{sequence floor='-0', rows=3}{$sequence} {/sequence}][{sequence round='00', rows=3}{$sequence} {/sequence}][{sequence '1..3', make, ceil='-0'}{$sequence} {/sequence}][{sequence '1..3', make, floor='0.0'}{$sequence} {/sequence}][{sequence '1..3', make, round='0.0'}{$sequence} {/sequence}][{sequence '1;2;3', flag, floor='-0'}{$sequence}{/sequence}][{sequence '0;1;2', flag, modulo='0.0'}{$sequence}{/sequence}]
|
|
App: regression/framework Page: sequence/ceil
PHP
|
HTML
sequence/ceil.pad
|
Result
|
|
{sequence ceil=3, rows=8} {$sequence}, {/sequence}
|
|
App: regression/framework Page: sequence/ceil_floor_round_and_modulo_answer_whole_numbers_whole
PHP
|
HTML
sequence/ceil_floor_round_and_modulo_answer_whole_numbers_whole.pad
|
Result
|
|
[{sequence floor=3, from=1000000000000000, rows=3}{$sequence} {/sequence}][{sequence ceil=2, from=100000000000001, rows=2}{$sequence} {/sequence}][{sequence round=5, from=123456789012347, rows=2}{$sequence} {/sequence}][{sequence '1000000000000001;77', make, ceil=2}{$sequence} {/sequence}][{sequence floor=3, from=1000000000000000, rows=3, sum}{$sequence}{/sequence}][{sequence floor=3, from=9007199254740993, rows=3}{$sequence} {/sequence}][{sequence modulo=10, from=9007199254740993, rows=3}{$sequence} {/sequence}][{sequence modulo=7, from=-9223372036854775808, rows=2}{$sequence} {/sequence}]
|
|
App: regression/framework Page: sequence/floor_and_ceil_round_to_a_multiple_of_a_negative_step_the_same_way
PHP
|
HTML
sequence/floor_and_ceil_round_to_a_multiple_of_a_negative_step_the_same_way.pad
|
Result
|
|
d[{sequence floor=-2, rows=5}{$sequence} {/sequence}] c[{sequence ceil=-2, rows=5}{$sequence} {/sequence}] m[{sequence '1..5', make, floor=-2}{$sequence} {/sequence}] n[{sequence '-5..-1', make, ceil=-2}{$sequence} {/sequence}] k[{sequence '1..10', keep, multiple=-3}{$sequence} {/sequence}] s[{sequence '1..4', make, step=-2}{$sequence} {/sequence}]
|
|
App: regression/framework Page: sequence/fractional_parameter_ceil
PHP
|
HTML
sequence/fractional_parameter_ceil.pad
|
Result
|
|
{sequence ceil=0.5, from=1, to=3} {$sequence}, {/sequence}
|
|
App: regression/framework Page: sequence/rounding_and_modulo_answer_zero_without_a_sign
PHP
|
HTML
sequence/rounding_and_modulo_answer_zero_without_a_sign.pad
|
Result
|
|
[{sequence modulo=3, from=-3, rows=4}{$sequence} {/sequence}][{sequence ceil=3, from=-2, rows=3}{$sequence} {/sequence}][{sequence round=3, from=-1, rows=2}{$sequence} {/sequence}]
|
|
App: sequence Page: basic/ceil
App: sequence Page: gallery
PHP
gallery.php
|
HTML
gallery.pad
|
Result
|
<?php
// The gallery: every sequence type that needs no parameter, its first 24 terms drawn as a // {sparkline}, the first eight written out, and the OEIS entry the terms come from - a // link to oeis.org, found in the table the oeis type reads (seqFunOeis in _lib/fun.php).
$drawn = [];
foreach ( seqFunTypes () as $type ) {
$terms = seqFunTerms ( $type, 24 ); $oeis = seqFunOeis ( $terms, $type );
$drawn [] = [ 'type' => $type, 'first' => implode ( ', ', array_slice ( $terms, 0, 8 ) ), 'oeis' => $oeis ? sprintf ( 'A%06d', $oeis ) : '' ];
}
?>
|
<p>Every sequence type that needs no parameter, its first 24 terms drawn by <code>{sparkline sequence=$type, rows=24}</code>, beside the <a href="https://oeis.org">OEIS</a> entry the terms come from. Follow a name to hear it.</p>
<table cellpadding="4"> {drawn} <tr> <td align="right"><a href="?listen&type={$type}">{$type}</a></td> <td>{sparkline sequence=$type, rows=24}</td> <td align="left"><small>{$first}, ...</small></td> <td>{if $oeis ne ''}<a href="https://oeis.org/{$oeis}">{$oeis}</a>{/if}</td> </tr> {/drawn} </table>
|
|
App: sequence Page: listen
PHP
listen.php
|
HTML
listen.pad
|
Result
|
<?php
// Listen: a sequence played as notes. Each of the first 32 terms becomes a note - the // term modulo 60, five octaves up from C2, the way the OEIS 'listen' button folds a term // into the keyboard - and the notes are written as a WAV file into the page itself // (seqFunWav in _lib/fun.php), so an <audio> element plays them without JavaScript. // Recamán's sequence, which jumps back and forth, is the famous one to listen to. // // type arrives from the query string and is used only when it names a type the gallery // draws.
$choices = seqFunTypes ();
if ( ! isset ( $type ) or ! is_string ( $type ) or ! in_array ( $type, $choices ) ) $type = 'recaman';
$terms = seqFunTerms ( $type, 32 ); $oeis = seqFunOeis ( $terms, $type ); $oeis = $oeis ? sprintf ( 'A%06d', $oeis ) : ''; $list = implode ( ', ', $terms ); $notes = implode ( ' ', array_map ( 'seqFunNoteName', seqFunNotes ( $terms ) ) ); $audio = seqFunWav ( $terms );
?>
|
<p>{choices}{notFirst} | {/notFirst}{if $choices eq $type}<b>{$choices}</b>@else@<a href="?listen&type={$choices}">{$choices}</a>{/if}{/choices}</p>
<h3>{$type | ucfirst}{if $oeis ne ''} - <a href="https://oeis.org/{$oeis}">{$oeis}</a>{/if}</h3>
{chart 'line', data='terms', title='{$type | ucfirst}, the first 32 terms', width=640, height=220}
<p><audio controls preload="none" src="{$audio}"></audio></p>
<p>Each term is a note: the term modulo 60, counted in semitones up from C2.</p>
<p><small>{$list}</small></p>
<p><small>{$notes}</small></p>
|
|
App: sequence Page: play/single/ceil
App: sequence Page: sequences
PHP
sequences.php
|
HTML
|
Result
|
<?php
echo "{table}";
echo str_pad ( "{demo}{sequence}", 38) . "{\$sequence} {/sequence} {/demo}";
foreach ( types () as $type ) {
$parm = pqParm ( $type );
if ( $type == 'oeis' ) $gox = "oeis=87"; elseif ( $type == 'list' ) $gox = "list='1;8;5;2;9;66'"; elseif ( $type == 'range' ) $gox = "range='1..10'"; elseif ( $type == 'eval' ) $gox = "eval='@ * 10 | @ - 1'"; elseif ( $type == 'random' ) $gox = 'random, maximal=99'; else $gox = "$type$parm";
echo str_pad ( "{demo}{sequence $gox}", 38) . "{\$sequence} {/sequence} {/demo}";
}
echo "{/table}";
?>
|
|
|
App: sequence Page: types/ceil
|