cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A107819 #15 Mar 08 2020 11:40:34
%S A107819 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 A107819 76,77,80,81,84,97,100,105,106,115,116,121,126,129,134,139,140,149,
%U A107819 150,153,154,165,176,179,180,183
%N A107819 Slowest increasing sequence where a(n)+n is prime.
%C A107819 Appears to be closely related to A014692.
%e A107819 (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 A107819 := proc(n)
%p A107819         option remember;
%p A107819         if n = 1 then
%p A107819                 return 1;
%p A107819         else
%p A107819                 for a from procname(n-1)+1 do
%p A107819                         if isprime(a+n) then
%p A107819                                 return a;
%p A107819                         end if;
%p A107819                 end do:
%p A107819         end if;
%p A107819 end proc: # _R. J. Mathar_, Sep 05 2011
%o A107819 (Sage)
%o A107819 @cached_function
%o A107819 def A107819(n):
%o A107819     prev = (-1 if n == 1 else A107819(n-1))
%o A107819     return next_prime(prev+n)-n  # _D. S. McNeil_, Sep 05 2011
%K A107819 easy,nonn
%O A107819 1,2
%A A107819 _Eric Angelini_, Jun 11 2005
%E A107819 Corrected by _R. J. Mathar_, Sep 05 2011