A225728
Primes p such that sum of primorials (A143293) not including p as a factor is divisible by p.
Original entry on oeis.org
Sum of primorials not including 3 as a factor is 1 + 2 = 3. Because it's divisible by 3, the latter is in the sequence.
Sum of primorials not including 17 as a factor is 1 + 2 + 6 + 6*5 + 30*7 + 210*11 + 2310*13 = 32589. Because 32589 is divisible by 17, the latter is in the sequence.
-
s=P=1;forprime(p=2,1e6,s+=P*=p;if(s%p==0,print1(p", "))) \\ Charles R Greathouse IV, Mar 19 2014
-
is(p)=if(!isprime(p),return(0)); my(s=Mod(1,p),P=s); forprime(q=2,p-1,s+=P*=q); s==0 \\ Charles R Greathouse IV, Mar 19 2014
-
primes = [2,3]
def addPrime(k):
for p in primes:
if k%p==0: return
if p*p > k: break
primes.append(k)
for n in range(5,1000000,6):
addPrime(n)
addPrime(n+2)
sum_ = 0
primorial = 1
for p in primes:
sum_ += primorial
primorial *= p
if sum_ % p == 0: print(p, end=', ')
-
from itertools import chain, accumulate, count, islice
from operator import mul
from sympy import prime
def A225728_gen(): return (prime(i+1) for i, m in enumerate(accumulate(accumulate(chain((1,),(prime(n) for n in count(1))), mul))) if m % prime(i+1) == 0)
A225728_list = list(islice(A225728_gen(), 3)) # Chai Wah Wu, Feb 23 2022
A225841
Numbers n such that the sum of first n primorial numbers is divisible by n.
Original entry on oeis.org
1, 2, 4, 523, 1046, 2092
Offset: 1
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.
-
With[{nn=2100},Select[Thread[{Accumulate[FoldList[Times,Prime[ Range[ nn]]]],Range[nn]}],Divisible[ #[[1]],#[[2]]]&]][[All,2]] (* Harvey P. Dale, Jul 29 2021 *)
-
list(maxx)={n=prime(1); cnt=1;summ=0;scnt=0;
while(n<=maxx,summ=summ+prodeuler(x=1,prime(cnt),x);
if(summ%cnt==0,scnt++;print(scnt," ",cnt) );cnt++;n=nextprime(n+1) ); }
\\note MUST increase precision to 10000+ digits \\Bill McEachen, Feb 04 2014
-
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
-
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
-
primes = []
n = 1
sum = 2
primorial = 6
def addPrime(k):
global n, sum, primorial
for p in primes:
if k%p==0: return
if p*p > k: break
primes.append(k)
sum += primorial
primorial *= k
n += 1
if sum % n == 0: print(n, end=',')
print(1, end=',')
for p in range(5, 100000, 6):
addPrime(p)
addPrime(p+2)
-
from itertools import accumulate, count, islice
from operator import mul
from sympy import prime
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)
A225841_list = list(islice(A225841_gen(),6)) # Chai Wah Wu, Feb 23 2022
Showing 1-2 of 2 results.
Comments