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.

A386256 Smallest semiprime p1*p2 such that p2 mod p1 = n and no prime is used more than once in the sequence.

This page as a plain text file.
%I A386256 #30 Aug 20 2025 14:27:03
%S A386256 6,35,377,407,817,391,3649,3131,4841,4331,11461,5293,7729,8051,12031,
%T A386256 25217,34417,29503,24931,33389,26051,57479,78227,44377,68557,15707,
%U A386256 78119,64829,197401,77059,166633,71371,140579,86147,96427,109237,84907,142523,213341,158801
%N A386256 Smallest semiprime p1*p2 such that p2 mod p1 = n and no prime is used more than once in the sequence.
%C A386256 Will every prime be used? If so, then the prime factors p1 and p2 of the terms, listed term by term, is a permutation of the primes.
%H A386256 Robert G. Wilson v, <a href="/A386256/b386256.txt">Table of n, a(n) for n = 1..400</a>
%e A386256 a(4) = 407 = 11 * 37 because 37 mod 11 = 4, and neither of these primes were used before in the sequence as a(1) = 2 * 3, a(2) = 5 * 7, and a(3) = 13 * 29, and so 11 and 37 are the earliest possible primes to satisfy the condition.
%e A386256 a(5) = 817 = 19 * 43 because 43 mod 19 = 5. Smaller candidate primes such as 13 and 31 would have been suitable, but 13 was already used for a(3) = 377 = 13 * 29. Therefore 19 and 43 are the earliest possible primes to satisfy the condition.
%t A386256 q[k_, n_, ps_] := Module[{f = FactorInteger[k], p1, p2}, If[f[[;; , 2]] != {1, 1}, {}, p1 = f[[1, 1]]; p2 = f[[2, 1]]; If[Mod[p2, p1] == n && ! MemberQ[ps, p1] && ! MemberQ[ps, p2], {p1, p2}, {}]]];
%t A386256 seq[nmax_] := Module[{ps = {}, s = {}, k, p}, Do[k = 6; While[(p = q[k, n, ps]) == {}, k++]; AppendTo[s, Times @@ p]; ps = Join[ps, p], {n, 1, nmax}]; s]; seq[40] (* _Amiram Eldar_, Aug 14 2025 *)
%t A386256 nsp[n_Integer] := nsp[n] = Block[{sp = n + 1}, While[ PrimeOmega[sp] != 2, sp++]; sp]; a[n_] := Block[{sp = 4}, While[fi = Flatten[ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger[ sp]]; Mod[ fi[[2]], fi[[1]]] != n || MemberQ[p, fi[[1]]] ||  MemberQ[p, fi[[2]]], sp = nsp[sp]]; AppendTo[p, fi[[1]]]; AppendTo[p, fi[[2]]]; sp]; p = {}; Do[Print[{n, f[n]}], {n, 50}] (* _Robert G. Wilson v_, Aug 20 2025 *)
%Y A386256 Cf. A000040, A064910.
%K A386256 nonn,changed
%O A386256 1,1
%A A386256 _Tamas Sandor Nagy_, Aug 14 2025