The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A156828 a(1) = 2. a(n) = the smallest prime >= a(n-1) + 4. 3

%I

%S 2,7,11,17,23,29,37,41,47,53,59,67,71,79,83,89,97,101,107,113,127,131,

%T 137,149,157,163,167,173,179,191,197,211,223,227,233,239,251,257,263,

%U 269,277,281,293,307,311,317,331,337,347,353,359,367,373,379,383,389

%N a(1) = 2. a(n) = the smallest prime >= a(n-1) + 4.

%C Apparently a(n) = A025584(n) for all n>2. Verified for indices n <= 100000. - _R. J. Mathar_, Mar 01 2010

%C Assume a(n-1) is in A025584 and greater than 3. Then, if a(n) = a(n-1) + 4, a(n-1) + 2 cannot be prime, and a(n) is in A025584. Otherwise, a(n) must still be in A025584, because if it were not, a(n) would not be the smallest valid prime. - _Charlie Neder_, Dec 16 2018

%H Vincenzo Librandi, <a href="/A156828/b156828.txt">Table of n, a(n) for n = 1..10000</a>

%p p := 2: for n from 1 to 100 do printf("%d,",p) ; p := nextprime(p+3) ; od: # _R. J. Mathar_, Feb 21 2009

%t a[1] = 2; a[n_] := a[n] = NextPrime[a[n - 1] + 3]; Array[a, 60] (* _Amiram Eldar_, Dec 16 2018 *)

%t NestList[NextPrime[#+3]&,2,60] (* _Harvey P. Dale_, Jan 05 2019 *)

%o (MAGMA) [n le 1 select 2 else NextPrime(Self(n-1)+3): n in [1..60]]; // _Vincenzo Librandi_, Dec 21 2018

%Y Cf. A156829.

%K nonn

%O 1,1

%A _Leroy Quet_, Feb 16 2009

%E More terms from _R. J. Mathar_, Feb 21 2009

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

Last modified June 1 09:53 EDT 2020. Contains 334762 sequences. (Running on oeis4.)