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.

A355643 Numbers k having a divisor d such that d+k/d is prime.

This page as a plain text file.
%I A355643 #16 Jul 13 2022 13:07:54
%S A355643 1,2,4,6,10,12,16,18,22,24,28,30,34,36,40,42,46,48,52,54,58,60,66,70,
%T A355643 72,76,78,82,84,88,90,96,100,102,106,108,112,114,118,120,126,130,132,
%U A355643 136,138,142,148,150,154,156,160,162,166,168,172,174,178,180,184,186,190,192,196,198,202,204,208
%N A355643 Numbers k having a divisor d such that d+k/d is prime.
%C A355643 All terms > 2 are congruent to 0 or 4 (mod 6).
%H A355643 Robert Israel, <a href="/A355643/b355643.txt">Table of n, a(n) for n = 1..10000</a>
%e A355643 a(10) = 24 is a term because 24 = 3*8 with 3+8 = 11 prime.
%p A355643 filter:= proc(n) local F,t;
%p A355643   F:= select(t -> t^2 <=n, numtheory:-divisors(n));
%p A355643   ormap(isprime, map(t -> t+n/t, F))
%p A355643 end proc:
%p A355643 select(filter, [$1..300]);
%t A355643 q[n_] := AnyTrue[Divisors[n], PrimeQ[# + n/#] &]; Select[Range[200], q] (* _Amiram Eldar_, Jul 11 2022 *)
%o A355643 (PARI) isok(k) = fordiv(k, d, if (isprime(d+k/d), return(1))); \\ _Michel Marcus_, Jul 11 2022
%o A355643 (Python)
%o A355643 from sympy import divisors, isprime
%o A355643 def ok(n): return any(isprime(d+n//d) for d in divisors(n, generator=True))
%o A355643 print([k for k in range(1, 210) if ok(k)]) # _Michael S. Branicky_, Jul 11 2022
%Y A355643 Contains A006093.
%Y A355643 Cf. A355644.
%K A355643 nonn
%O A355643 1,2
%A A355643 _J. M. Bergot_ and _Robert Israel_, Jul 11 2022