1Math::NumSeq::TotientStUespesrSuCmo(n3t)ributed Perl DocMuamtehn:t:aNtuimoSneq::TotientStepsSum(3)
2
3
4
6 Math::NumSeq::TotientStepsSum -- sum of repeated totients to reach 1
7
9 use Math::NumSeq::TotientStepsSum;
10 my $seq = Math::NumSeq::TotientStepsSum->new;
11 my ($i, $value) = $seq->next;
12
14 The sum of the totients on repeatedly applying the totient function to
15 reach 1.
16
17 1, 3, 6, 7, 12, 9, 16, 15, 18, 17, 28, 19, 32, ...
18
19 For example i=5 applying the totient function goes 5 -> 4 -> 2 -> 1 so
20 total value=5+4+2+1=12.
21
22 The default is to include the initial i itself in the sum. Option
23 "including_self => 0" excludes, in which case for example i=5 has
24 value=4+2+1=7.
25
26 0, 1, 3, 3, 7, 3, 9, 7, 9, 7, 17, 7, 19, ...
27
28 See Math::NumSeq::TotientPerfect for totient sums equal to i itself.
29
31 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
32 classes.
33
34 "$seq = Math::NumSeq::TotientStepsSum->new ()"
35 Create and return a new sequence object.
36
37 Random Access
38 "$value = $seq->ith($i)"
39 Return the totient steps sum running i down to 1.
40
42 Math::NumSeq, Math::NumSeq::Totient, Math::NumSeq::TotientSteps,
43 Math::NumSeq::TotientPerfect
44
46 <http://user42.tuxfamily.org/math-numseq/index.html>
47
49 Copyright 2011, 2012, 2013, 2014, 2016, 2019, 2020 Kevin Ryde
50
51 Math-NumSeq is free software; you can redistribute it and/or modify it
52 under the terms of the GNU General Public License as published by the
53 Free Software Foundation; either version 3, or (at your option) any
54 later version.
55
56 Math-NumSeq is distributed in the hope that it will be useful, but
57 WITHOUT ANY WARRANTY; without even the implied warranty of
58 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
59 General Public License for more details.
60
61 You should have received a copy of the GNU General Public License along
62 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
63
64
65
66perl v5.34.1 2022-06-06 Math::NumSeq::TotientStepsSum(3)