OFFSET
2,1
COMMENTS
From Robert Israel, Apr 20 2017: (Start)
a(n) = A078701(prime(n-1)+prime(n+1)) unless that is 1, in which case a(n)=2.
a(n) = 2 if and only if for some m, A007053(m) = n or n-1 with prime(n-1)+prime(n+1) = 2^(m+1). The first m for which this occurs are 3,4,9,379,593, corresponding to n = 4,7,97 and approximately 3*10^116 and 1*10^181. Are there infinitely many? (End)
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
MAPLE
f:= proc(n) local t; t:= min(numtheory:-factorset(ithprime(n-1)+ithprime(n+1)) minus {2}); if t::integer then t else 2 fi end proc:
map(f, [$2..200]); # Robert Israel, Apr 20 2017
MATHEMATICA
f[n_] := Block[{k = 3, s = Prime[n - 1] + Prime[n + 1]}, While[Mod[s, k] != 0 && k <= s, k += 2]; If[k > s, 2, k]]; Table[ f[n], {n, 2, 92}]
PROG
(PARI) a(n) = {p = prime(n); s = precprime(p-1) + nextprime(p+1); f = factor(s); if (#f~ > 1, f[2, 1], f[1, 1]); } \\ Michel Marcus, Apr 22 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Jan 11 2006
STATUS
approved