%I #56 Feb 23 2022 15:52:32
%S 1,2,4,523,1046,2092
%N Numbers n such that the sum of first n primorial numbers is divisible by n.
%C The k-th primorial number is defined as the product of the first k primes.
%C The next term, if it exists, is greater than 14000000. - _Alex Ratushnyak_, Jun 13 2013
%C If a prime p | a(n) for some n, then p = 2, p = 523, or p > 10^8. Any such prime is itself a member of this sequence. From this (and a small amount of additional calculation) it follows that any other terms below 10^10 are of the form 2^k * p for p > 10^8. - _Charles R Greathouse IV_, Feb 09 2014
%e 2 + 2*3 + 2*3*5 + 2*3*5*7 = 2 + 6 + 30 + 210 = 248, because 248 is divisible by 4, the latter is in the sequence.
%t With[{nn=2100},Select[Thread[{Accumulate[FoldList[Times,Prime[ Range[ nn]]]],Range[nn]}],Divisible[ #[[1]],#[[2]]]&]][[All,2]] (* _Harvey P. Dale_, Jul 29 2021 *)
%o (Python)
%o primes = []
%o n = 1
%o sum = 2
%o primorial = 6
%o def addPrime(k):
%o global n, sum, primorial
%o for p in primes:
%o if k%p==0: return
%o if p*p > k: break
%o primes.append(k)
%o sum += primorial
%o primorial *= k
%o n += 1
%o if sum % n == 0: print(n, end=',')
%o print(1, end=',')
%o for p in range(5, 100000, 6):
%o addPrime(p)
%o addPrime(p+2)
%o (PARI) list(maxx)={n=prime(1); cnt=1;summ=0;scnt=0;
%o while(n<=maxx,summ=summ+prodeuler(x=1,prime(cnt),x);
%o if(summ%cnt==0,scnt++;print(scnt," ",cnt) );cnt++;n=nextprime(n+1) ); }
%o \\note MUST increase precision to 10000+ digits \\_Bill McEachen_, Feb 04 2014
%o (PARI) P=1;S=n=0;forprime(p=2,1e4,S+=P*=p;if(S%n++==0,print1(n", "))) \\ _Charles R Greathouse IV_, Feb 05 2014
%o (PARI) is(n)=my(q=prime(n),P=Mod(1,n),S);forprime(p=2,q,S+=P*=p);!S \\ _Charles R Greathouse IV_, Feb 05 2014
%o (Python)
%o from itertools import accumulate, count, islice
%o from operator import mul
%o from sympy import prime
%o def A225841_gen(): return (i+1 for i, m in enumerate(accumulate(accumulate((prime(n) for n in count(1)), mul))) if m % (i+1) == 0)
%o A225841_list = list(islice(A225841_gen(),6)) # _Chai Wah Wu_, Feb 23 2022
%Y Cf. A060389, A002110, A045345, A143293, A225727.
%K nonn,hard,more
%O 1,2
%A _Alex Ratushnyak_, May 21 2013
|