|
|
A356374
|
|
a(n) is the first prime that starts a string of exactly n consecutive primes that are in A347702.
|
|
0
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(n) is the first prime that starts a string of exactly n consecutive primes that are quasi-Niven numbers, i.e., have remainder 1 when divided by the sum of their digits.
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) = 11 because [11, 13, 17] is the first string of exactly 3 consecutive primes that are quasi-Niven numbers: 11 mod (1+1) = 1, 13 mod (1+3) = 1 and 17 mod (1+7) = 1, while the preceding prime 7 and the next prime 23 are not quasi-Niven.
|
|
MAPLE
|
filter:= proc(n) n mod convert(convert(n, base, 10), `+`) = 1 end proc:
V:= Vector(5): count:= 0:
s:= 0: p:= 1:
while count < 5 do
p:= nextprime(p);
if filter(p) then
s:= s+1;
if s = 1 then p0:= p fi
elif s > 0 then
if s <= 5 and V[s] = 0 then V[s]:= p0; count:= count+1 fi;
s:= 0;
fi
od:
convert(V, list);
|
|
MATHEMATICA
|
seq[len_, pmax_] := Module[{s = Table[0, {len}], v = {}, p = 2, c = 0, pfirst = 2, i}, While[c < len && p < pmax, If[Divisible[p - 1, Plus @@ IntegerDigits[p]], AppendTo[v, p]; If[pfirst == 0, pfirst = p], i = Length[v]; v = {}; If[0 < i <= len && s[[i]] == 0, s[[i]] = pfirst]; pfirst = 0]; p = NextPrime[p]]; s]; seq[4, 10^6] (* Amiram Eldar, Aug 04 2022 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|