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.

A057626 Initial prime in first sequence of n primes congruent to 2 modulo 5.

This page as a plain text file.
%I A057626 #14 Jan 07 2024 14:05:29
%S A057626 2,337,1627,57427,192637,776257,15328637,70275277,244650317,452942827,
%T A057626 452942827,73712513057,319931193737,2618698284817,10993283241587,
%U A057626 54010894438097,101684513099627,196948379177587
%N A057626 Initial prime in first sequence of n primes congruent to 2 modulo 5.
%C A057626 Same as A068150 except a(1). - _Jens Kruse Andersen_, Jun 03 2006
%H A057626 J. K. Andersen, <a href="http://primerecords.dk/congruent-primes.htm">Consecutive Congruent Primes</a>.
%e A057626 a(5) = 192637 because this number is the first in a sequence of 5 consecutive primes all of the form 5n + 2.
%t A057626 NextPrime[ n_Integer ] := Module[ {k = n + 1}, While[ ! PrimeQ[ k ], k++ ]; Return[ k ] ]; PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; Return[ k ] ]; p = 0; Do[ a = Table[ -1, {n} ]; k = Max[ 1, p ]; While[ Union[ a ] != {2}, k = NextPrime[ k ]; a = Take[ AppendTo[ a, Mod[ k, 5 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 9} ]
%t A057626 Module[{nn=13410000,pr5},pr5=Table[If[Mod[p,5]==2,1,0],{p,Prime[Range[nn]]}];Prime/@ Table[SequencePosition[pr5,PadRight[{},n,1],1],{n,8}]][[;;,1,1]] (* The program generates the first 8 terms of the sequence. *) (* _Harvey P. Dale_, Jan 07 2024 *)
%K A057626 nonn
%O A057626 1,1
%A A057626 _Robert G. Wilson v_, Oct 09 2000
%E A057626 More terms from _Jens Kruse Andersen_, Jun 03 2006
%E A057626 a(15)-a(18) from _Giovanni Resta_, Aug 04 2013