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.
%I A031217 #24 Jul 02 2025 16:01:56 %S A031217 2,3,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, %T A031217 2,3,2,2,3,2,2,2,2,2,2,3,2,2,2,2,2,2,2,4,3,2,2,2,2,2,2,2,2,2,2,2,2,2, %U A031217 2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2 %N A031217 Number of terms in longest arithmetic progression of consecutive primes starting at n-th prime (conjectured to be unbounded). %C A031217 a(n) <= 4 for n <= 10^5. - _Reinhard Zumkeller_, Feb 02 2007 %C A031217 The first instance of 4 consecutive primes in an arithmetic progression is (251, 257, 263, 269), which starts with the 54th prime. The first instance of 5 consecutive primes in an arithmetic progression is (9843019, 9843049, 9843079, 9843109, 9843139), which starts with the 654926th prime. [_Harvey P. Dale_, Jul 13 2011] %D A031217 R. K. Guy, Unsolved Problems in Number Theory, A6. %H A031217 R. Zumkeller, <a href="/A031217/b031217.txt">Table of n, a(n) for n = 1..10000</a> %H A031217 <a href="/index/Pri#primes_AP">Index entries for sequences related to primes in arithmetic progressions</a> %e A031217 At 47 there are 3 consecutive primes in A.P., 47 53 59. %t A031217 max = 5; a[n_] := Catch[pp = NestList[ NextPrime, Prime[n], max-1]; Do[ If[ Length[ Union[ Differences[pp[[1 ;; -k]] ] ] ] == 1, Throw[max-k+1]], {k, 1, max-1}]]; Table[a[n], {n, 1, 105}] (* _Jean-François Alcover_, Jul 17 2012 *) %t A031217 Length[Split[Differences[#]][[1]]]&/@Partition[Prime[Range[120]],10,1]+1 (* _Harvey P. Dale_, Mar 17 2024 *) %o A031217 (PARI) a(n)=my(p=prime(n),q=nextprime(p+1),g=q-p,k=2); while(nextprime(q+1)==q+g, q+=g; k++); k \\ _Charles R Greathouse IV_, Jun 20 2013 %Y A031217 Cf. A001223. %K A031217 nonn,easy,nice %O A031217 1,1 %A A031217 _N. J. A. Sloane_ %E A031217 More terms from _James Sellers_