|
|
A371403
|
|
Least k such that prime(k), prime(k+1), prime(k+2), ..., prime(k+n) all have the same last digit.
|
|
0
|
|
|
34, 258, 2147, 11582, 62192, 274810, 1500309, 2235294, 10919138, 24000612, 3074210315, 6244442805, 6244442805
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The interest in studying a sequence of n consecutive prime numbers having the same last digit is to look at the behavior of the rarefaction of these numbers when n becomes large.
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = A107730(1) = 34 because prime(34) = 139, prime(35) = 149, both end with the digit 9, and no two consecutive smaller primes end with the same digit.
a(2) = 258 because prime(258) = 1627, prime(259) = 1637, prime(260) = 1657 with the same last digit 7, and no three consecutive smaller primes have the same last digit.
|
|
MAPLE
|
nn:=15*10^6:
for n from 2 to 7 do :
ii:=0:d:=array(1..n):
for m from 1 to nn while(ii=0)
do:
lst:={}:
for k from 1 to n do:
d[k]:=irem(ithprime(m+k-1), 10):
lst:=lst union {d[k]}:
od:
if lst={d[1]}
then
printf(`%d %d \n`, n-1, m):ii:=1:
else
fi:
od:
od:
|
|
MATHEMATICA
|
a[n_] := Module[{v = Mod[Prime[Range[n + 1]], 10], k = 1, p}, p = Prime[n + 1]; While[! SameQ @@ v, p = NextPrime[p]; v = Join[Rest[v], {Mod[p, 10]}]; k++]; k]; Array[a, 6] (* Amiram Eldar, Mar 21 2024 *)
|
|
PROG
|
(PARI)
upto(n) = {
n += 30;
my(res = List(), q = 2, t = 1, ld = 2, nld, streak = 0);
forprime(p = 3, oo,
nld = p%10;
if(nld == ld,
streak++;
if(streak > #res,
listput(res, t-streak+1);
print1(t-streak+1", ");
)
,
streak = 0
);
q = p;
ld = nld;
t++;
if(t > n,
return(res);
)
);
res
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,hard,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|