login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A087128
a(1)=1 and, for n>1, a(n) is the smallest positive integer such that 1+Sum_{k=a(n-1)+1..a(n)} k is prime.
3
1, 2, 5, 6, 13, 22, 25, 34, 37, 46, 58, 61, 73, 97, 106, 142, 145, 178, 181, 193, 202, 205, 217, 226, 238, 253, 277, 286, 298, 313, 346, 358, 382, 385, 394, 430, 433, 442, 466, 502, 529, 541, 553, 562, 565, 586, 682, 685, 694, 697, 709, 718, 721, 733, 838, 841
OFFSET
1,2
COMMENTS
It appears that, for n>4, all differences a(n+1)-a(n) are multiples of 3. The sequence of differences is A087129.
This is true because if a(n-1) == 1 (mod 3), 1 + Sum_{k=a(n-1)+1..t} k == 2*(t^2+t) (mod 3), so this would be divisible by 3 unless t == 1 (mod 3). - Robert Israel, Feb 19 2017
LINKS
EXAMPLE
a(2)=2 since 1+(2)=3 is prime. a(3)=5 since 1+(3+4+5)=13 is prime.
MAPLE
A[1]:= 1:
for n from 2 to 100 do
for b from A[n-1]+1 do
if isprime(1+(1+A[n-1]+b)*(b-A[n-1])/2) then A[n]:= b; break fi
od od:
seq(A[n], n=1..100); # Robert Israel, Feb 19 2017
CROSSREFS
Cf. A087129 (first differences).
Sequence in context: A027010 A038191 A321472 * A154365 A247959 A243799
KEYWORD
nonn,changed
AUTHOR
John W. Layman, Aug 16 2003
STATUS
approved