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.

A180942 Odd composite numbers m for which A000111(m) == (-1)^( (m-1)/2 ) (mod m).

Original entry on oeis.org

91, 561, 781, 1105, 1661, 1729, 2465, 2737, 2821, 6601, 8911, 10585, 15841, 29341, 30433, 41041, 46657, 52633, 62745, 63973, 75361, 90241, 101101, 115921, 126217, 136371, 136741, 137149, 162401, 172081, 176565, 188461, 251251, 252601, 278545, 294409, 314821, 334153
Offset: 1

Views

Author

Vladimir Shevelev, Sep 27 2010

Keywords

Comments

For any odd prime p, A000111(p) == (-1)^((p-1)/2) mod p, see A180418, so these cases are not considered further and left out of the sequence by definition.
Might be called "Zig-zag pseudoprimes."
It seems that every Carmichael number (A002997) <= 512461 is in the sequence. - D. S. McNeil, Sep 01 2010

Crossrefs

Cf. A000111.

Programs

  • Mathematica
    fQ[n_] := ! PrimeQ@n && Mod[ (-1)^((n - 1)/2)*2^(n + 1)*(2^(n + 1) - 1)*BernoulliB[n + 1]/(n + 1), n] == Mod[(-1)^((n - 1)/2), n]; k = 3; lst = {}; While[k < 50000, If[ fQ@k, AppendTo[lst, k]; Print@k]; k += 2]; lst (* Robert G. Wilson v, Sep 29 2010 *)
  • Python
    from itertools import count, islice, accumulate
    from sympy import isprime
    def A180942_gen(): # generator of terms
        blist = (0,1)
        for n in count(2):
            blist = tuple(accumulate(reversed(blist),initial=0))
            if n & 1 and (blist[-1] + (1 if (n-1)//2 & 1 else -1)) % n == 0 and not isprime(n):
                yield n
    A180942_list = list(islice(A180942_gen(),5)) # Chai Wah Wu, Jun 09-11 2022

Extensions

Extended to a(13) by D. S. McNeil, Sep 01 2010
Comments rephrased by R. J. Mathar, Sep 29 2010
a(14)-a(17) from Robert G. Wilson v, Sep 29 2010
a(18)-a(38) from Amiram Eldar, Dec 28 2019