login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181103 a(n) is the least prime greater than a(n-1) such that abs(a(n-2) + a(n-1) - a(n)) is prime; a(1)=2, a(2)=3. 4

%I #17 Sep 08 2022 08:45:54

%S 2,3,7,13,17,19,23,29,41,47,59,83,89,101,107,137,173,179,239,251,257,

%T 269,293,311,347,389,419,449,467,557,563,599,641,647,701,761,809,827,

%U 839,857,887,947,953,971,977,1019,1049,1091,1109,1151,1163,1217,1229

%N a(n) is the least prime greater than a(n-1) such that abs(a(n-2) + a(n-1) - a(n)) is prime; a(1)=2, a(2)=3.

%C Partial products are in A181737.

%H Nathaniel Johnston, <a href="/A181103/b181103.txt">Table of n, a(n) for n = 1..10000</a>

%p 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

%t 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 *)

%o (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

%Y Cf. A181737.

%K nonn,easy

%O 1,1

%A _Giovanni Teofilatto_, Oct 03 2010

%E Definition refined and sequence extended by _R. J. Mathar_, Oct 12 2010

%E Index in definition corrected by _R. J. Mathar_, Oct 26 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 00:03 EDT 2024. Contains 371798 sequences. (Running on oeis4.)