login
A390831
Numbers of terms of 1+A081411 that are divisible by prime(n).
0
1, 3, 8, 3, 29, 35, 18, 181, 348, 160, 117, 962, 623, 322, 1858, 1620, 1766, 3805, 7224, 9750, 5791, 37943, 59154, 27100, 97583, 61986, 125112, 130775, 163947, 243437, 480984, 627486, 473240, 1461949, 2675131, 2063109, 2623502, 1680273, 8040568, 2970378, 4191532
OFFSET
1,2
EXAMPLE
For n=2, a(2)=3 because there are only 3 terms of 1+A081411 divisible by prime(2)=3; they are 3, 33, 129 at indices 2, 5, 6.
For n=3, a(3)=8 because there are only 8 terms of 1+A081411 divisible by prime(3)=5; they are at indices 3, 8, 9, 13, 22, 23, 27, 33.
MATHEMATICA
seq[numprimes_] := Module[{d = Differences[Prime[Range[numprimes]]], ps, ind, np, s, primes, r = 1}, ps = Union[Flatten[Map[FactorInteger[#][[;; , 1]] &, Select[Union[d], # > 1 &]]]]; ind = PrimePi[ps]; np = First @ Complement[Range[ind[[-1]] + 1], ind] - 1; s = Table[0, {np}]; primes = Prime[Range[np]]; Do[r *= d[[i]]; Do[If[Divisible[r + 1, ps[[j]]], s[[j]]++], {j, 1, np}], {i, 1, Length[d]}]; s]; seq[10^5] (* Amiram Eldar, Nov 21 2025 *)
PROG
(PARI) a(n) = my(c=0, p=2, r=Mod(1, prime(n))); forprime(q=3, oo, r*=(q-p); if(r==-1, c++); if(r==0, return(c)); p=q); \\ Jinyuan Wang, Nov 28 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Nov 21 2025
EXTENSIONS
a(16)-a(21) from Amiram Eldar, Nov 21 2025
a(22)-a(41) from Jinyuan Wang, Nov 28 2025
STATUS
approved