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).

This page as a plain text file.
%I A180942 #29 Jun 11 2022 11:44:04
%S A180942 91,561,781,1105,1661,1729,2465,2737,2821,6601,8911,10585,15841,29341,
%T A180942 30433,41041,46657,52633,62745,63973,75361,90241,101101,115921,126217,
%U A180942 136371,136741,137149,162401,172081,176565,188461,251251,252601,278545,294409,314821,334153
%N A180942 Odd composite numbers m for which A000111(m) == (-1)^( (m-1)/2 ) (mod m).
%C A180942 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.
%C A180942 Might be called "Zig-zag pseudoprimes."
%C A180942 It seems that every Carmichael number (A002997) <= 512461 is in the sequence. - _D. S. McNeil_, Sep 01 2010
%H A180942 Vladimir Shevelev, <a href="http://www.emis.de/journals/INTEGERS/papers/m1/m1.Abstract.html">The number of permutations with prescribed up-down structure as a function of two variables</a>, INTEGERS 12 (2012), article #A1. - From _N. J. A. Sloane_, Feb 07 2013
%t A180942 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 *)
%o A180942 (Python)
%o A180942 from itertools import count, islice, accumulate
%o A180942 from sympy import isprime
%o A180942 def A180942_gen(): # generator of terms
%o A180942     blist = (0,1)
%o A180942     for n in count(2):
%o A180942         blist = tuple(accumulate(reversed(blist),initial=0))
%o A180942         if n & 1 and (blist[-1] + (1 if (n-1)//2 & 1 else -1)) % n == 0 and not isprime(n):
%o A180942             yield n
%o A180942 A180942_list = list(islice(A180942_gen(),5)) # _Chai Wah Wu_, Jun 09-11 2022
%Y A180942 Cf. A000111.
%K A180942 nonn
%O A180942 1,1
%A A180942 _Vladimir Shevelev_, Sep 27 2010
%E A180942 Extended to a(13) by _D. S. McNeil_, Sep 01 2010
%E A180942 Comments rephrased by _R. J. Mathar_, Sep 29 2010
%E A180942 a(14)-a(17) from _Robert G. Wilson v_, Sep 29 2010
%E A180942 a(18)-a(38) from _Amiram Eldar_, Dec 28 2019