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”).

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.
8
3, 9, 15, 54, 290, 987, 4530, 21481, 58554, 60967, 136456, 136456, 673393, 1254203, 1254203, 7709873, 21357253, 21357253, 25813464, 25813464, 39500857, 39500857, 947438659, 947438659, 947438659, 5703167678, 5703167678, 16976360924, 68745739764, 117327812949
OFFSET
1,1
COMMENTS
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
LINKS
FORMULA
a(n) = primepi(A057622(n)). - Michel Marcus, Oct 01 2014
EXAMPLE
a(1)= 3 => prime(3) == 5 (mod 6).
a(2)= 9 => prime(9) == 5 (mod 6), prime(10) == 5 (mod 6).
a(3)= 15 => prime(15) == 5 (mod 6), prime(16) == 5 (mod 6), prime(17) == 5 (mod 6).
From Michel Marcus, Sep 30 2014: (Start)
The resulting primes are:
5;
23, 29;
47, 53, 59;
251, 257, 263, 269;
1889, 1901, 1907, 1913, 1931;
7793, 7817, 7823, 7829, 7841, 7853;
43451, 43457, 43481, 43487, 43499, 43517, 43541;
243161, 243167, 243197, 243203, 243209, 243227, 243233, 243239;
... (End)
MAPLE
for n from 1 to 22 do :
ii:=0:
for k from 3 to 10^5 while (ii=0)do :
s:=0:
for i from 0 to n-1 do:
r:=irem(ithprime(k+i), 6):
if r = 5
then
s:=s+1:
else
fi:
od:
if s=n and ii=0
then
printf ( "%d %d \n", n, k):ii:=1:
else
fi:
od:
od:
MATHEMATICA
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 *)
PROG
(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
(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
(MATLAB)
N = 2*10^8; % to use primes up to N
P = mod(primes(N), 6);
P5 = find(P==5);
n5 = numel(P5);
a(1) = P5(1);
for k = 2:100
r = find(P5(k:n5) == P5(1:n5+1-k)+k-1, 1, 'first');
if numel(r) == 0
break
end
a(k) = P5(r);
end
a % Robert Israel, Sep 02 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Sep 28 2014
EXTENSIONS
a(11)-a(22) from A057622 by Michel Marcus, Oct 03 2014
a(23)-a(25) from Jinyuan Wang, Jul 08 2019
a(26)-a(30) added using A057622 by Jinyuan Wang, Apr 15 2020
STATUS
approved