Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Feb 06 2021 22:09:56
%S 7,8,9,11,12,13,15,18,19,28,31,32,34,36,44,46,47,51,52,62,64,67,69,70,
%T 73,83,88,109,110,112,128,148,153,159,189,190,192,206,212,214,222,224,
%U 226,244,245,261,267,269,280,282,283,287,300,305,312,315,319,323,366,370,378,381,388,394,404
%N Numbers k such that A340740(k) is prime.
%H Robert Israel, <a href="/A340741/b340741.txt">Table of n, a(n) for n = 1..5000</a>
%e a(3) = 9 is a term because A340740(9) = 2 is prime.
%p f:= proc(n) local k;
%p add(`if`(igcd(k,n)=1, n mod k, 0),k=1..floor(n/2))
%p end proc:
%p select(t -> isprime(f(t)), [$1..1000]);
%t A340741[n_] :=
%t Position[Table[
%t PrimeQ[Sum[
%t Mod[m, i]*Floor[1/GCD[i, m]], {i, Floor[(m - 1)/2]}]], {m, 1,
%t n}], True] // Flatten;
%t A340741[404] (* _Robert P. P. McKone_, Jan 19 2021 *)
%o (PARI) isok(n) = isprime(sum(k=1, n\2, if (gcd(k, n)==1, n%k))); \\ _Michel Marcus_, Jan 18 2021
%Y Cf. A340731, A340740, A340742.
%K nonn
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Jan 18 2021