login

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

a(n) = 2*n mod q, where q is the greatest prime such that 2*n - q is also prime.
0

%I #7 Dec 03 2024 12:47:09

%S 0,0,3,3,5,3,3,5,3,3,5,3,5,7,3,3,5,7,3,5,3,3,5,3,5,7,3,5,7,3,3,5,7,3,

%T 5,3,3,5,7,3,5,3,5,7,3,5,7,19,3,5,3,3,5,3,3,5,3,5,7,13,11,13,19,3,5,3,

%U 5,7,3,3,5,7,11,11,3,3,5,7,3,5,7,3,5,3,5,7,3,5,7,3,3,5,7,11,11,3,3,5

%N a(n) = 2*n mod q, where q is the greatest prime such that 2*n - q is also prime.

%t Table[Module[{p = 2, q},

%t While[True, q = 2 n - p; If[PrimeQ[p] && PrimeQ[q], Break[]];

%t p = NextPrime[p]]; Mod[2 n, q]], {n, 2, 100}]

%Y Cf. A002373.

%K nonn,new

%O 2,3

%A _Michel Eduardo Beleza Yamagishi_, Nov 19 2024