%I #20 Aug 17 2022 23:07:57
%S 131,41,11,178909,304290583,8345111009
%N a(n) is the first prime that starts a string of exactly n consecutive primes that are in A347702.
%C 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.
%C a(7) > 3*10^11, if it exists. - _Amiram Eldar_, Aug 04 2022
%e 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.
%p filter:= proc(n) n mod convert(convert(n,base,10),`+`) = 1 end proc:
%p V:= Vector(5): count:= 0:
%p s:= 0: p:= 1:
%p while count < 5 do
%p p:= nextprime(p);
%p if filter(p) then
%p s:= s+1;
%p if s = 1 then p0:= p fi
%p elif s > 0 then
%p if s <= 5 and V[s] = 0 then V[s]:= p0; count:= count+1 fi;
%p s:= 0;
%p fi
%p od:
%p convert(V,list);
%t 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 *)
%Y Cf. A007605, A136251, A209871, A347702.
%K nonn,base,more
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Aug 04 2022
%E a(5)-a(6) from _Amiram Eldar_, Aug 04 2022
|