NAME
Math::NumSeq::NumAronson -- numerical version of Aronson's sequence
SYNOPSIS
use Math::NumSeq::NumAronson;
my $seq = Math::NumSeq::NumAronson->new;
my ($i, $value) = $seq->next;
DESCRIPTION
This is a s numerical version of Aronson's self-referential sequence by Cloitre, Sloane and Vandermast, 1,4,6,7,8,9,11,13,etc.
http://arxiv.org/abs/math.NT/0305308
Starting from a(1)=1 the rule is "n is in the sequence iff a(n) is odd". The result is 3 increments by 1 then 3 increment by 2, followed by 6 increments by 1 and 6 increments by 2, then 12, 24, 48, etc.
1, 4
6, 7, 8, 9, 11, 13
15, 16, 17, 18, 19, 20, 21, 23, 25, 27, 29, 31
In general
numaronson(9*2^k-3+j) = 12*2^k - 3 + (3*j+abs(j))/2
where -3*2^k <= j < 3*2^k
The (3*j+abs(j))/2 part is the step, going by 1 if j<=0 and by 2 if j>0.
FUNCTIONS
See "FUNCTIONS" in Math::NumSeq for the behaviour common to all path classes.
$seq = Math::NumSeq::NumAronson->new (key=>value,...)
-
Create and return a new sequence object.
$value = $seq->ith($i)
-
Return the
$i
th value in the sequence. $bool = $seq->pred($value)
-
Return true if
$value
occurs in the sequence.
SEE ALSO
Math::NumSeq, Math::NumSeq::Aronson
HOME PAGE
http://user42.tuxfamily.org/math-numseq/index.html
LICENSE
Copyright 2010, 2011 Kevin Ryde
Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.