1Math::NumSeq::DedekindPUssieSrteCposn(t3r)ibuted Perl DoMcautmhe:n:tNautmiSoenq::DedekindPsiSteps(3)
2
3
4
6 Math::NumSeq::DedekindPsiSteps -- psi function until 2^x*3^y
7
9 use Math::NumSeq::DedekindPsiSteps;
10 my $seq = Math::NumSeq::DedekindPsiSteps->new;
11 my ($i, $value) = $seq->next;
12
14 This sequence is the how many repeated applications of the Dedekind psi
15 function are required to reach a number of the form 2^x*3^y.
16
17 0,0,0,0,1,0,1,0,0,1,1,0,2,1,1,0,1,0,2,1,1,1,1,0,2,2,0,1,2,...
18
19 The psi function is
20
21 psi(n) = product (p+1) * p^(e-1)
22 prime factors p^e in n
23
24 The p+1 means that one copy of each distinct prime in n is changed from
25 p to p+1. That p+1 is even, so although the value has increased the
26 prime factors are all less than p. Repeated applying that reduction
27 eventually reaches just primes 2 and 3 in some quantity.
28
29 For example i=25 requires 2 steps,
30
31 psi(25) = (5+1)*5 = 30 = 2*3*5
32 then
33 psi(30) = (2+1)*(3+1)*(5+1) = 72 = 2*2*2*3*3
34
35 If i is already 2s and 3s then it's considered no steps are required
36 and the value is 0. For example at i=12=2*2*3 the value is 0.
37
39 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
40 classes.
41
42 "$seq = Math::NumSeq::DedekindPsiSteps->new ()"
43 Create and return a new sequence object.
44
45 Random Access
46 "$value = $seq->ith($i)"
47 Return the number of repeated applications of the psi function on
48 $i required to reach just factors 2 and 3.
49
50 This calculation requires factorizing $i and in the current code
51 after small factors a hard limit of 2**32 is enforced in the
52 interests of not going into a near-infinite loop. Above that the
53 return is "undef".
54
56 Math::NumSeq, Math::NumSeq::TotientSteps,
57 Math::NumSeq::DedekindPsiCumulative
58
60 <http://user42.tuxfamily.org/math-numseq/index.html>
61
63 Copyright 2012, 2013, 2014, 2016, 2019 Kevin Ryde
64
65 Math-NumSeq is free software; you can redistribute it and/or modify it
66 under the terms of the GNU General Public License as published by the
67 Free Software Foundation; either version 3, or (at your option) any
68 later version.
69
70 Math-NumSeq is distributed in the hope that it will be useful, but
71 WITHOUT ANY WARRANTY; without even the implied warranty of
72 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
73 General Public License for more details.
74
75 You should have received a copy of the GNU General Public License along
76 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
77
78
79
80perl v5.34.0 2021-07-22 Math::NumSeq::DedekindPsiSteps(3)