OFFSET
1,1
COMMENTS
Partial products are in A181737.
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
MAPLE
A181103 := proc(n) option remember: local p: if(n<=2)then return n+1: fi: p:=procname(n-1): do p:=nextprime(p): if(isprime(abs(p-procname(n-2)-procname(n-1))))then return p: fi: od: end: seq(A181103(n), n=1..53); # Nathaniel Johnston, May 27 2011
MATHEMATICA
nxt[{a_, b_}]:=Module[{lp=NextPrime[b]}, While[!PrimeQ[Abs[a+b-lp]], lp= NextPrime[ lp]]; {b, lp}]; Transpose[NestList[nxt, {2, 3}, 60]][[1]] (* Harvey P. Dale, Feb 08 2015 *)
PROG
(Magma) A181103:=function(n); S:=[2, 3]; if n le 2 then return S[n]; end if; p:=5; for k in [3..n] do while not IsPrime(Abs(S[k-2]+S[k-1]-p)) do p:=NextPrime(p); end while; Append(~S, p); if k eq n then return p; end if; p:=NextPrime(p); end for; end function; [ A181103(n): n in [1..55] ]; // Klaus Brockhaus, Dec 19 2010
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Giovanni Teofilatto, Oct 03 2010
EXTENSIONS
Definition refined and sequence extended by R. J. Mathar, Oct 12 2010
Index in definition corrected by R. J. Mathar, Oct 26 2010
STATUS
approved