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.

A247967 a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 5, 5, ... for i = 0, 1, ..., n-1.

This page as a plain text file.
%I A247967 #48 Sep 06 2024 08:06:10
%S A247967 3,9,15,54,290,987,4530,21481,58554,60967,136456,136456,673393,
%T A247967 1254203,1254203,7709873,21357253,21357253,25813464,25813464,39500857,
%U A247967 39500857,947438659,947438659,947438659,5703167678,5703167678,16976360924,68745739764,117327812949
%N A247967 a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 5, 5, ... for i = 0, 1, ..., n-1.
%C A247967 Weakening the definition to prime(k+i) == 2 (mod 3) yields a(1) = 1, but all other terms are unchanged. See also A247816 (residue 5) or A276414 (equal residues, all 1 or all -1). - _M. F. Hasler_, Sep 02 2016
%H A247967 Amiram Eldar, <a href="/A247967/b247967.txt">Table of n, a(n) for n = 1..35</a>
%F A247967 a(n) = primepi(A057622(n)). - _Michel Marcus_, Oct 01 2014
%e A247967 a(1)= 3 => prime(3) == 5 (mod 6).
%e A247967 a(2)= 9 => prime(9) == 5 (mod 6), prime(10) == 5 (mod 6).
%e A247967 a(3)= 15 => prime(15) == 5 (mod 6), prime(16) == 5 (mod 6), prime(17) == 5 (mod 6).
%e A247967 From _Michel Marcus_, Sep 30 2014: (Start)
%e A247967 The resulting primes are:
%e A247967   5;
%e A247967   23, 29;
%e A247967   47, 53, 59;
%e A247967   251, 257, 263, 269;
%e A247967   1889, 1901, 1907, 1913, 1931;
%e A247967   7793, 7817, 7823, 7829, 7841, 7853;
%e A247967   43451, 43457, 43481, 43487, 43499, 43517, 43541;
%e A247967   243161, 243167, 243197, 243203, 243209, 243227, 243233, 243239;
%e A247967   ... (End)
%p A247967 for n from 1 to 22 do :
%p A247967 ii:=0:
%p A247967    for k from 3 to 10^5 while (ii=0)do :
%p A247967      s:=0:
%p A247967       for i from 0 to n-1 do:
%p A247967         r:=irem(ithprime(k+i),6):
%p A247967         if r = 5
%p A247967         then
%p A247967         s:=s+1:
%p A247967         else
%p A247967         fi:
%p A247967       od:
%p A247967        if s=n and ii=0
%p A247967        then
%p A247967        printf ( "%d %d \n",n,k):ii:=1:
%p A247967        else
%p A247967        fi:
%p A247967     od:
%p A247967 od:
%t A247967 Table[k = 1; While[Times @@ Boole@ Map[Mod[Prime[k + #], 6] == 5 &, Range[0, n - 1]] == 0, k++]; k, {n, 10}] (* _Michael De Vlieger_, Sep 02 2016 *)
%o A247967 (PARI) a(n) = {k = 1; ok = 0; while (!ok, nb = 0; for (i=0, n-1, if (prime(k+i) % 6 == 5, nb++, break);); if (nb == n, ok=1, k++);); k;} \\ _Michel Marcus_, Sep 28 2014
%o A247967 (PARI) m=c=i=0;forprime(p=1,, i++;p%6!=5&&(!c||!c=0)&&next; c++>m||next; print1(1+i-m=c,",")) \\ _M. F. Hasler_, Sep 02 2016
%o A247967 (MATLAB)
%o A247967 N = 2*10^8; % to use primes up to N
%o A247967 P = mod(primes(N),6);
%o A247967 P5 = find(P==5);
%o A247967 n5 = numel(P5);
%o A247967 a(1) = P5(1);
%o A247967 for k = 2:100
%o A247967   r = find(P5(k:n5) == P5(1:n5+1-k)+k-1,1,'first');
%o A247967   if numel(r) == 0
%o A247967      break
%o A247967   end
%o A247967   a(k) = P5(r);
%o A247967 end
%o A247967 a % _Robert Israel_, Sep 02 2016
%Y A247967 Cf. A057622, A247816, A276414.
%K A247967 nonn
%O A247967 1,1
%A A247967 _Michel Lagneau_, Sep 28 2014
%E A247967 a(11)-a(22) from A057622 by _Michel Marcus_, Oct 03 2014
%E A247967 a(23)-a(25) from _Jinyuan Wang_, Jul 08 2019
%E A247967 a(26)-a(30) added using A057622 by _Jinyuan Wang_, Apr 15 2020