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.

A194231 Numbers k such that at least one of k and k+2 is composite, while for every b coprime to k*(k+2), b^(k-1) == 1 (mod k) and b^(k+1) == 1 (mod k+2).

This page as a plain text file.
%I A194231 #49 Apr 24 2024 02:45:10
%S A194231 561,1103,2465,2819,6599,29339,41039,52631,62743,172079,188459,278543,
%T A194231 340559,488879,656599,656601,670031,1033667,1909001,2100899,3146219,
%U A194231 5048999,6049679,8719307,10024559,10402559,10877579,11119103,12261059,14913989,15247619
%N A194231 Numbers k such that at least one of k and k+2 is composite, while for every b coprime to k*(k+2), b^(k-1) == 1 (mod k) and b^(k+1) == 1 (mod k+2).
%C A194231 These might be called "Carmichael pseudo-twin-primes".
%H A194231 Amiram Eldar, <a href="/A194231/b194231.txt">Table of n, a(n) for n = 1..10000</a>
%F A194231 For every b coprime to a(n)*(a(n)+2), 2*b^(a(n)+1) == (b^2-1)*(a(n)+2) (mod a(n)*(a(n)+2)). Conversely (_Max Alekseyev_), if for every b coprime to N*(N+2), 2*b^(N+1) == (b^2-1)*(N+2) (mod N*(N+2)), then N is in the sequence. - _Vladimir Shevelev_, Oct 14 2011
%p A194231 with(numtheory):
%p A194231 ic:= proc(n) local p;
%p A194231        if not issqrfree(n) then false
%p A194231      else for p in factorset(n) do
%p A194231             if irem (n-1, p-1)<>0 then return false fi
%p A194231           od; true
%p A194231        fi
%p A194231      end:
%p A194231 a:= proc(n) option remember; local k;
%p A194231       for k from 2 +`if`(n=1, 1, a(n-1)) by 2 while
%p A194231         isprime(k) and isprime(k+2) or not (ic(k) and ic(k+2))
%p A194231       do od; k
%p A194231     end:
%p A194231 seq(a(n), n=1..10);  # _Alois P. Heinz_, Oct 12 2011
%t A194231 terms = 31; bMax = 20(* sufficient for 31 terms *); coprimes[n_] := Select[ Range[bMax], CoprimeQ[#, n]&]; Reap[For[n = m = 1, m <= terms, n += 2, If[CompositeQ[n] || CompositeQ[n+2], If[AllTrue[coprimes[n(n+2)], PowerMod[#, n-1, n] == 1 && PowerMod[#, n+1, n+2] == 1&], Print["a(", m, ") = ", n]; Sow[n]; m++]]]][[2, 1]] (* _Jean-François Alcover_, Mar 28 2017 *)
%Y A194231 Cf. A002997, A001567, A141232.
%Y A194231 Subsequences: A272754, A290692.
%K A194231 nonn
%O A194231 1,1
%A A194231 _Vladimir Shevelev_, Oct 12 2011