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.

A091847 Perfect totient numbers, omitting powers of 3.

Original entry on oeis.org

15, 39, 111, 183, 255, 327, 363, 471, 2199, 3063, 4359, 4375, 5571, 8751, 15723, 36759, 46791, 65535, 140103, 208191, 441027, 4190263, 9056583, 57395631, 172186887, 236923383, 918330183, 3932935775, 4294967295, 4764161215
Offset: 1

Views

Author

N. J. A. Sloane, Mar 13 2004

Keywords

Crossrefs

A082897 has more information.

Programs

  • Mathematica
    fQ[n_] := !IntegerQ@ Log[3, n] && Plus @@ FixedPointList[ EulerPhi@# &, n] == 2n + 1 (* Robert G. Wilson v, Nov 06 2010 *)
  • Python
    from itertools import count, islice
    from gmpy2 import digits
    from sympy import totient
    def A091847_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:
                m, s = n, 1
                while (m:=totient(m))>1:
                    s += m
                if s == n:
                    yield n
    A091847_list = list(islice(A091847_gen(),10)) # Chai Wah Wu, Mar 24 2023