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!)
A107819 Slowest increasing sequence where a(n)+n is prime. 2

%I #15 Mar 08 2020 11:40:34

%S 1,3,4,7,8,11,12,15,20,21,26,29,30,33,38,43,44,49,52,53,58,61,66,73,

%T 76,77,80,81,84,97,100,105,106,115,116,121,126,129,134,139,140,149,

%U 150,153,154,165,176,179,180,183

%N Slowest increasing sequence where a(n)+n is prime.

%C Appears to be closely related to A014692.

%e (1)+1=2, which is prime; (3)+2=5=prime; (4)+3=7=prime; (7)+4=11=prime; (8)+5=13=prime; etc.

%p A107819 := proc(n)

%p option remember;

%p if n = 1 then

%p return 1;

%p else

%p for a from procname(n-1)+1 do

%p if isprime(a+n) then

%p return a;

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Sep 05 2011

%o (Sage)

%o @cached_function

%o def A107819(n):

%o prev = (-1 if n == 1 else A107819(n-1))

%o return next_prime(prev+n)-n # _D. S. McNeil_, Sep 05 2011

%K easy,nonn

%O 1,2

%A _Eric Angelini_, Jun 11 2005

%E Corrected by _R. J. Mathar_, Sep 05 2011

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 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)