OFFSET
1,1
COMMENTS
Terms appearing twice: a(1)=a(4)=7, a(5)=a(16)=31,...,
terms appearing thrice: a(28)=a(47)=a(142)=283, a(20)=a(61)=a(184)=367, etc.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
n=1: 7+2 is multiple of 3, n=2: 3+2 is multiple of 5, n=5: 31+2 is multiple of 11, n=8: 83+2 is multiple of 17.
MATHEMATICA
s={}; Do[k=2; While[Mod[2+(p=Prime[k]), n]>0, k++ ]; AppendTo[s, p], {n, 3, 2001, 2}]; s
PROG
(Python)
from sympy import nextprime
def a(n):
p, m = 2, 2*n+1
while (p+2)%m: p = nextprime(p)
return p
print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Jul 03 2021
(PARI) a(n) = my(p=2); while ((p+2) % (2*n+1), p = nextprime(p+1)); p; \\ Michel Marcus, Jul 03 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 16 2010
STATUS
approved