cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 27 results. Next

A343243 Sociable totient numbers of order 3: numbers k such that s(s(s(k))) = k, but s(k) != k, where s(k) = A092693(k) is the sum of iterated phi function.

Original entry on oeis.org

20339, 21159, 23883, 35503, 43255, 45375, 365599, 476343, 493047, 746383, 979839, 1097367, 3331135, 3816831, 3972543, 57720703, 68705247, 78376959, 3031407415, 3742563231, 3866214695
Offset: 1

Views

Author

Amiram Eldar, Apr 08 2021

Keywords

Comments

The numbers k such that s(k) = k are the perfect totient numbers (A082897).
a(22) > 2*10^10, if it exists.

Examples

			20339 is a term since s(20339) = 23883, s(23883) = 21159 and s(21159) = 20339.
		

Crossrefs

Programs

  • Mathematica
    totSum[n_] := Plus @@ FixedPointList[EulerPhi, n] - n - 1; soc3TotQ[n_] := Nest[totSum, n, 3] == n && totSum[n] != n; Select[Range[2, 10^6], soc3TotQ]

A082897 Perfect totient numbers.

Original entry on oeis.org

3, 9, 15, 27, 39, 81, 111, 183, 243, 255, 327, 363, 471, 729, 2187, 2199, 3063, 4359, 4375, 5571, 6561, 8751, 15723, 19683, 36759, 46791, 59049, 65535, 140103, 177147, 208191, 441027, 531441, 1594323, 4190263, 4782969, 9056583, 14348907, 43046721
Offset: 1

Views

Author

Douglas E. Iannucci, Jul 21 2003

Keywords

Comments

It is trivial that perfect totient numbers must be odd. It is easy to show that powers of 3 are perfect totient numbers.
The product of the first n Fermat primes (A019434) is also a perfect totient number. There are 57 terms under 10^11. - Jud McCranie, Feb 24 2012
Terms 15, 255, 65535 and 4294967295 also belong to A051179 (see Theorem 4 in Loomis link). - Michel Marcus, Mar 19 2014
For the first 64 terms, a(n) is approximately 1.56^n. - Jud McCranie, Jun 17 2017
These numbers were first studied in 1939 by the Spanish mathematician Laureano Pérez-Cacho Villaverde (1900-1957). The term "perfect totient number" was coined by Venkataraman (1975). - Amiram Eldar, Mar 10 2021

Examples

			327 is a perfect totient number because 327 = 216 + 72 + 24 + 8 + 4 + 2 + 1. Note that 216 = phi(327), 72 = phi(216), 24 = phi(72) and so on.
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section B41, pp. 147-150.
  • L. Pérez-Cacho, Sobre la suma de indicadores de órdenes sucesivos (in Spanish), Revista Matematica Hispano-Americana, Vol.5, No. 3 (1939), pp. 45-50.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 3, pp. 240-242.
  • D. L. Silverman, Problem 1040, J. Recr. Math., Vol. 14 (1982); Solution by R. I. Hess, ibid., Vol. 15 (1983).

Crossrefs

Cf. A092693 (sum of iterated phi(n)). See also A091847.

Programs

  • Maple
    with(numtheory):
    A082897_list := proc(N) local k,p,n,L;
    L := NULL;
    for n from 3 by 2 to N do
    k := 0; p := phi(n);
    while 1 < p do k := k + p; p := phi(p) od;
    if k + 1 = n then L := L,n fi
    od; L end: # Peter Luschny, Nov 01 2010
  • Mathematica
    kMax = 57395631; a = Table[0, {kMax}]; PTNs = {}; Do[e = EulerPhi[k]; a[[k]] = e + a[[e]]; If[k == a[[k]], AppendTo[PTNs, k]], {k, 2, kMax}]; PTNs
    perfTotQ[n_] := Plus @@ FixedPointList[ EulerPhi@ # &, n] == 2n + 1; Select[Range[1000], perfTotQ] (* Robert G. Wilson v, Nov 06 2010 *)
  • PARI
    S(n)={n=eulerphi(n);if(n==1,1,n+S(n))}
    for(n=2,1e3,if(S(n)==n,print1(n", "))) \\ Charles R Greathouse IV, Mar 29 2012; Corrected by Dana Jacobsen, Dec 16 2018
    
  • Perl
    use ntheory "euler_phi"; sub S { my $n=euler_phi(shift); return 1 if $n == 1; $n+S($n); }   for (2..1e4) { say if $==S($); } # Dana Jacobsen, Dec 16 2018
    
  • Python
    from itertools import count, islice
    from gmpy2 import digits
    from sympy import totient
    def A082897_gen(startvalue=3): # generator of terms >= startvalue
        for n in count((k:=max(startvalue,3))+1-(k&1),2):
            t = digits(n,3)
            if t.count('0') == len(t)-1:
                yield n
            else:
                m, s = n, 1
                while (m:=totient(m))>1:
                    s += m
                if s == n:
                    yield n
    A082897_list = list(islice(A082897_gen(),20)) # Chai Wah Wu, Mar 24 2023

Formula

n is a perfect totient number if S(n) = n, where S(n) = phi(n) + phi^2(n) + ... + 1, where phi is Euler's totient function and phi^2(n) = phi(phi(n)), ..., phi^k(n) = phi(phi^(k-1)(n)).
n such that n = A092693(n).
n such that 2n = A053478(n). - Vladeta Jovovic, Jul 02 2004
n log log log log n << a(n) <= 3^n. - Charles R Greathouse IV, Mar 22 2012

Extensions

Corrected by T. D. Noe, Mar 11 2004

A053478 Sum of iterates when phi, A000010, is iterated until fixed point 1.

Original entry on oeis.org

1, 3, 6, 7, 12, 9, 16, 15, 18, 17, 28, 19, 32, 23, 30, 31, 48, 27, 46, 35, 40, 39, 62, 39, 60, 45, 54, 47, 76, 45, 76, 63, 68, 65, 74, 55, 92, 65, 78, 71, 112, 61, 104, 79, 84, 85, 132, 79, 110, 85, 114, 91, 144, 81, 126, 95, 112, 105, 164, 91, 152, 107, 118, 127, 144, 101
Offset: 1

Views

Author

Labos Elemer, Jan 14 2000

Keywords

Comments

For n = 2^w, the sum is 2^(w+1) - 1.

Examples

			If phi is applied repeatedly to n = 91, the iterates {91, 72, 24, 8, 4, 2, 1} are obtained. Their sum is a(91) = 91 + 72 + 24 + 8 + 4 + 2 + 1 = 202.
		

Crossrefs

Programs

  • Haskell
    a053478 = (+ 1) . sum . takeWhile (/= 1) . iterate a000010
    -- Reinhard Zumkeller, Oct 27 2011
    
  • Mathematica
    f[n_] := Plus @@ Drop[ FixedPointList[ EulerPhi, n], -1]; Table[ f[n], {n, 66}] (* Robert G. Wilson v, Dec 16 2004 *)
    f[1] := 1; f[n_] := n + f[EulerPhi[n]]; Table[f[n], {n, 66}] (* Carlos Eduardo Olivieri, May 26 2015 *)
  • PARI
    a(n)=my(s=n);while(n>1,s+=n=eulerphi(n)); s \\ Charles R Greathouse IV, Feb 21 2013

Formula

a(n) = n + a(phi(n)).
a(n) = A092693(n) + n. - Vladeta Jovovic, Jul 02 2004

A331273 Sum of the iterated exponential totient function (A072911).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Feb 25 2020

Keywords

Comments

Analogous to A092693 with the exponential totient function ephi instead of the Euler totient function phi (A000010).
a(n) = 1 for n > 1 which is cubefree (A004709) and a(n) > 1 for n in A046099.

Examples

			a(8) = ephi(8) + ephi(ephi(8)) = 2 + 1 = 3 (where ephi is A072911).
		

Crossrefs

Programs

  • Mathematica
    ephi[n_] := Times @@ EulerPhi[FactorInteger[n][[;; , 2]]]; s[n_] := Plus @@ FixedPointList[ephi, n] - n - 1; Array[s, 100]

A092694 Product of iterated phi(n).

Original entry on oeis.org

1, 1, 2, 2, 8, 2, 12, 8, 12, 8, 80, 8, 96, 12, 64, 64, 1024, 12, 216, 64, 96, 80, 1760, 64, 1280, 96, 216, 96, 2688, 64, 1920, 1024, 1280, 1024, 1536, 96, 3456, 216, 1536, 1024, 40960, 96, 4032, 1280, 1536, 1760, 80960, 1024, 4032, 1280, 32768, 1536, 79872, 216
Offset: 1

Views

Author

T. D. Noe, Mar 04 2004

Keywords

Comments

A logarithmic plot of this sequence shows an unusual banded structure.

Examples

			a(100) = 40960 because the iterations of phi (40, 16, 8, 4, 2, 1) have a product of 40960.
		

Crossrefs

Cf. A003434 (iterations of phi(n) needed to reach 1), A092693 (iterated phi sum).
Cf. A000010.

Programs

  • Haskell
    a092694 n = snd $ until ((== 1) . fst) f (a000010 n, 1) where
       f (x, p) = (a000010 x, p * x)
    -- Reinhard Zumkeller, Jan 30 2014
    
  • Mathematica
    nMax=100; a=Table[1, {nMax}]; Do[e=EulerPhi[n]; a[[n]]=e*a[[e]], {n, 2, nMax}]; a
  • Python
    from sympy import totient
    from math import prod
    def f(n):
        m = n
        while m > 1:
            m = totient(m)
            yield m
    def A092694(n): return prod(f(n)) # Chai Wah Wu, Nov 14 2021

Formula

a(1) = 1, a(n) = phi(n) * a(phi(n))

A288452 Pseudoperfect totient numbers: numbers n such that equal the sum of a subset of their iterated phi(n).

Original entry on oeis.org

3, 5, 7, 9, 11, 13, 15, 17, 19, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 59, 61, 65, 67, 69, 71, 73, 77, 79, 81, 83, 85, 87, 89, 97, 101, 103, 107, 109, 111, 113, 115, 119, 121, 123, 125, 127, 131, 137, 139, 141, 143, 149, 151, 153, 155
Offset: 1

Views

Author

Amiram Eldar, Jun 09 2017

Keywords

Comments

Analogous to A005835 (pseudoperfect numbers) as A082897 (perfect totient numbers) is analogous to A000396 (perfect numbers).
All the odd primes are in this sequence.
Number of terms < 10^k: 4, 40, 350, 2956, 24842, etc. - Robert G. Wilson v, Jun 17 2017
All terms are odd. If n is even, phi(n) <= n/2, and except for n = 2, we will have phi(n) also even. So the sum of the phi sequence < n*(1/2 + 1/4 + ...) = n. - Franklin T. Adams-Watters, Jun 25 2017

Examples

			The iterated phi of 25 are 20, 8, 4, 2, 1 and 25 = 20 + 4 + 1.
		

Crossrefs

Supersequence of A082897. Subsequence of A286265.

Programs

  • Mathematica
    pseudoPerfectTotQ[n_]:= Module[{tots = Most[Rest[FixedPointList[EulerPhi@# &, n]]]}, MemberQ[Total /@ Subsets[tots, Length[tots]], n]]; Select[Range[155], pseudoPerfectTotQ]
  • PARI
    subsetSum(v, target)=if(setsearch(v,target), return(1)); if(#v<2, return(target==0)); my(u=v[1..#v-1]); if(target>v[#v] && subsetSum(u, target-v[#v]), return(1)); subsetSum(u,target);
    is(n)=if(isprime(n), return(n>2)); my(v=List(),k=n); while(k>1, listput(v,k=eulerphi(k))); subsetSum(Set(v),n) \\ Charles R Greathouse IV, Jun 25 2017

A329153 Sum of the iterated unitary totient function (A047994).

Original entry on oeis.org

0, 1, 3, 6, 10, 3, 9, 16, 24, 10, 20, 9, 21, 9, 24, 39, 55, 24, 42, 21, 21, 20, 42, 23, 47, 21, 47, 42, 70, 24, 54, 85, 41, 55, 47, 47, 83, 42, 47, 70, 110, 21, 63, 54, 117, 42, 88, 54, 102, 47, 117, 83, 135, 47, 110, 63, 83, 70, 128, 47, 107, 54, 102, 165, 102
Offset: 1

Views

Author

Amiram Eldar, Feb 25 2020

Keywords

Comments

Analogous to A092693 with the unitary totient function uphi instead of the Euler totient function phi (A000010).

Examples

			a(4) = uphi(4) + uphi(uphi(4)) + uphi(uphi(uphi(4))) = 3 + 2 + 1 = 6.
		

Crossrefs

Programs

  • Mathematica
    uphi[1] = 1; uphi[n_] := Times @@ (-1 + Power @@@ FactorInteger[n]); Table[Plus @@ FixedPointList[uphi, n] - n - 1, {n, 1, 100}]

Formula

a(n) = n for n in A286067.

A385745 The sum of the iterated infinitary analog of the totient function A384247 when started at n.

Original entry on oeis.org

0, 1, 3, 6, 10, 3, 9, 10, 18, 10, 20, 9, 21, 9, 18, 33, 49, 18, 36, 21, 21, 20, 42, 18, 42, 21, 36, 36, 64, 18, 48, 49, 41, 49, 42, 42, 78, 36, 42, 49, 89, 21, 63, 48, 81, 42, 88, 48, 96, 42, 81, 78, 130, 36, 89, 42, 78, 64, 122, 42, 102, 48, 96, 96, 96, 41, 107
Offset: 1

Views

Author

Amiram Eldar, Jul 08 2025

Keywords

Examples

			  n | iterations            | a(n)
  --+-----------------------+--------------------
  2 | 2 -> 1                | 1
  3 | 3 -> 2 -> 1           | 2 + 1 = 3
  4 | 4 -> 3 -> 2 -> 1      | 3 + 2 + 1 = 6
  5 | 5 -> 4 -> 3 -> 2 -> 1 | 4 + 3 + 2 + 1 = 10
  6 | 6 -> 2 -> 1           | 2 + 1 = 3
		

Crossrefs

Similar sequences: A092693, A329153, A333611.

Programs

  • Mathematica
    f[p_, e_] := p^e*(1 - 1/p^(2^(IntegerExponent[e, 2]))); iphi[1] = 1; iphi[n_] := iphi[n] = Times @@ f @@@ FactorInteger[n];
    a[n_] := Plus @@ NestWhileList[iphi, n, # != 1 &] - n; Array[a, 100]
  • PARI
    iphi(n) = {my(f = factor(n)); n * prod(i = 1, #f~, (1 - 1/f[i, 1]^(1 << valuation(f[i, 2], 2)))); }
    a(n) = if(n ==  1, 0, my(i = iphi(n)); i + a(i));

A333611 Sum of the iterated infinitary totient function iphi (A091732).

Original entry on oeis.org

0, 1, 3, 6, 10, 3, 9, 6, 14, 10, 20, 9, 21, 9, 14, 29, 45, 14, 32, 21, 21, 20, 42, 9, 33, 21, 45, 32, 60, 14, 44, 29, 41, 45, 33, 33, 69, 32, 33, 21, 61, 21, 63, 44, 61, 42, 88, 44, 92, 33, 61, 69, 121, 45, 61, 32, 69, 60, 118, 33, 93, 44, 92, 106, 92, 41, 107
Offset: 1

Views

Author

Amiram Eldar, Mar 28 2020

Keywords

Examples

			a(3) = iphi(3) + iphi(iphi(3)) = 2 + 1 = 3.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(2^(-1 + Position[Reverse @ IntegerDigits[e, 2], 1])); iphi[1] = 1; iphi[n_] := Times @@ (Flatten@(f @@@ FactorInteger[n]) - 1); a[n_] := Plus @@ NestWhileList[iphi, n, # != 1 &] - n; Array[a, 100]

A333871 Sum of the iterated absolute Möbius divisor function (A173557).

Original entry on oeis.org

0, 1, 3, 1, 5, 3, 9, 1, 3, 5, 15, 3, 15, 9, 9, 1, 17, 3, 21, 5, 15, 15, 37, 3, 5, 15, 3, 9, 37, 9, 39, 1, 25, 17, 27, 3, 39, 21, 27, 5, 45, 15, 57, 15, 9, 37, 83, 3, 9, 5, 33, 15, 67, 3, 45, 9, 39, 37, 95, 9, 69, 39, 15, 1, 51, 25, 91, 17, 59, 27, 97, 3, 75, 39
Offset: 1

Views

Author

Amiram Eldar, Apr 08 2020

Keywords

Comments

Analogous to A092693 with the absolute Möbius divisor function (A173557) instead of the Euler totient function phi (A000010).

Examples

			a(3) = A173557(3) + A173557(A173557(3)) = 2 + 1 = 3.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p - 1; u[1] = 1; u[n_] := Times @@ (f @@@ FactorInteger[n]); a[n_] := Plus @@ FixedPointList[u, n] - n - 1 ; Array[a, 100]
Previous Showing 11-20 of 27 results. Next