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.

A085417 Take prime[n] and continue adding n,n+1,..., n+a(n)-1 until one reaches a prime.

This page as a plain text file.
%I A085417 #8 Mar 24 2023 17:01:43
%S A085417 1,1,3,1,3,1,3,9,3,5,3,5,3,12,4,9,3,1,3,4,3,1,4,1,7,1,7,5,3,4,3,1,3,1,
%T A085417 3,8,3,9,7,5,4,1,8,12,4,4,15,1,8,21,3,5,24,9,12,8,3,4,3,9,11,4,3,5,48,
%U A085417 1,7,33,3,1,3,1,15,12,3,5,8,5,3,36,19,1,3,5,11,5,12,5,4,4,3,1,3,5,3,1,15,1
%N A085417 Take prime[n] and continue adding n,n+1,..., n+a(n)-1 until one reaches a prime.
%C A085417 Primes obtained are in A085418. See also A085415, A085416.
%C A085417 No terms == 2 (mod 4). - _Robert Israel_, Mar 24 2023
%H A085417 Robert Israel, <a href="/A085417/b085417.txt">Table of n, a(n) for n = 1..10000</a>
%e A085417 a(3)=3 because prime[3]=5 and 5+(3+4+5)=17= is a prime A085418(3).
%p A085417 f:= proc(n) local m,k,x;
%p A085417   m:= ithprime(n) - (n-1)*n/2;
%p A085417   for k from n do
%p A085417     x:= k*(k+1)/2 + m;
%p A085417     if isprime(x) then return k+1-n fi
%p A085417   od;
%p A085417 end proc:
%p A085417 map(f, [$1..100]); # _Robert Israel_, Mar 24 2023
%Y A085417 Cf. A085415, A085416, A085418.
%K A085417 easy,nonn
%O A085417 1,3
%A A085417 _Zak Seidov_, Jun 30 2003