login
A330310
Let p = prime(n); a(n) = (p-1)/2 if that is prime, or (p+1)/2 if that is prime, and otherwise p itself.
2
2, 2, 2, 3, 5, 7, 17, 19, 11, 29, 31, 19, 41, 43, 23, 53, 29, 31, 67, 71, 37, 79, 41, 89, 97, 101, 103, 53, 109, 113, 127, 131, 137, 139, 149, 151, 79, 163, 83, 173, 89, 181, 191, 97, 197, 199, 211, 223, 113, 229, 233, 239, 241, 251, 257, 131, 269, 271, 139
OFFSET
1,1
LINKS
MAPLE
a:=[2];
for n from 2 to 80 do p:=ithprime(n);
if isprime((p-1)/2) then t:=(p-1)/2; elif isprime((p+1)/2) then t:=(p+1)/2 else t:=p; fi;
a:=[op(a), t];
od: a;
PROG
(PARI) a(n) = { my (p=prime(n), q); if (p%2, if (isprime(q=(p-1)/2), return (q), isprime(q=(p+1)/2), return (q))); return (p) } \\ Rémy Sigrist, Dec 11 2019
CROSSREFS
Suggested by A328686.
Sequence in context: A014208 A243358 A059690 * A121256 A022867 A268595
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 10 2019
STATUS
approved