NAME
Math::NumSeq::JugglerSteps  steps in the juggler sqrt sequence
SYNOPSIS
use Math::NumSeq::JugglerSteps;
my $seq = Math::NumSeq::JugglerSteps>new;
my ($i, $value) = $seq>next;
DESCRIPTION
This is the number of steps it takes to reach 1 by the Juggler sqrt sequence,
n > / floor(n^(1/2)) if n even
\ floor(n^(3/2)) if n odd
So sqrt if n even, or sqrt(n^3) if n odd, each rounded downwards. For example i=17 goes 17 > sqrt(17^3)=70 > sqrt(70)=8 > sqrt(8)=2 > sqrt(2)=1, for a count of 4 steps.
0, 1, 6, 2, 5, 2, 4, 2, 7, 7, 4, 7, 4, 7, 6, 3, 4, 3, 9, 3, ...
starting i=1
The intermediate values in the calculation can become quite large and Math::BigInt
is used if necessary. There's some secret experimental caching in a temporary file, for a small speedup.
FUNCTIONS
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::JugglerSteps>new ()
$seq = Math::NumSeq::JugglerSteps>new (step_type => 'both', juggler_type => '1/23/2')

Create and return a new sequence object.
The optional
step_type
parameter (a string) selects between"up" upward steps sqrt(n^3) "down" downward steps sqrt(n) "both" both up and down, which is the default
The optional
juggler_type
parameter (a string) selects among variations on the poweringn even n odd "1/23/2" sqrt(n) and sqrt(n^3) "2/33/2" cbrt(n^2) and sqrt(n^3) "3/44/3" n^(3/4) and n^(4/3)
Random Access
$value = $seq>ith($i)

Return the number of steps to take
$i
down to 1. $bool = $seq>pred($value)

Return true if
$value
occurs as a step count. This is simply$value >= 0
.
SEE ALSO
Math::NumSeq, Math::NumSeq::CollatzSteps, Math::NumSeq::ReverseAddSteps
HOME PAGE
http://user42.tuxfamily.org/mathnumseq/index.html
LICENSE
Copyright 2010, 2011, 2012, 2013 Kevin Ryde
MathNumSeq 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.
MathNumSeq 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 MathNumSeq. If not, see <http://www.gnu.org/licenses/>.