login
a(n) = gcd(Sum_{k=1..n} prime(k), Product{j=1..n} prime(j)).
2

%I #39 Mar 23 2024 17:31:44

%S 2,1,10,1,14,1,2,77,10,3,10,1,238,1,82,3,110,3,2,213,2,7,874,3,530,

%T 129,158,3,370,177,430,3,994,3,2,3,646,2747,2914,21,3266,3,3638,3,

%U 2014,3,14,4661,1222,5117,1070,69,5830,3,2,6601,6870,7141,2,1,26,5

%N a(n) = gcd(Sum_{k=1..n} prime(k), Product{j=1..n} prime(j)).

%C From _M. F. Hasler_, Mar 10 2014: (Start)

%C The terms a(n) must have the same parity as the sum of the first n primes, A007504(n), which is the opposite of the parity of the index n. Otherwise said, the sequence is congruent to 0,1,0,1,0,1,... (mod 2).

%C The since the terms of this sequence are divisors of primorials A002110, they are squarefree numbers, A005117.

%C Is it true, and if so, can it be proved that

%C * all of the squarefree numbers do appear?

%C * all of the squarefree numbers do appear infinitely often?

%C At least it seems that this is the case for the terms 1, 2 and 3. (End)

%C A239070(n) = position of first occurrence of n-th squarefree number in this sequence. - _Reinhard Zumkeller_, Mar 10 2014

%H Alois P. Heinz, <a href="/A132995/b132995.txt">Table of n, a(n) for n = 1..10000</a> (first 9592 terms from M. F. Hasler)

%F A132995(n) = gcd(A007504(n), A002110(n)). - _M. F. Hasler_, Mar 10 2014

%e The first 7 primes are 2,3,5,7,11,13,17. 2+3+5+7+11+13+17 = 58 = 2*29. So a(7) = gcd(58, 2*3*5*7*11*13*17) = 2.

%p seq(gcd(add(ithprime(i),i=1..n), mul(ithprime(j),j=1..n)), n=1..50); # _Emeric Deutsch_, Nov 24 2007

%p # second Maple program:

%p with(numtheory):

%p s:= proc(n) s(n):= `if`(n=0, 0, s(n-1)+ithprime(n)) end:

%p a:= n-> mul(`if`(i<=ithprime(n), i, 1), i=factorset(s(n))):

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Mar 10 2014

%t nn=60;With[{prs=Prime[Range[nn]]},Table[GCD[Total[Take[prs,n]], Times@@Take[ prs,n]],{n,nn}]] (* _Harvey P. Dale_, May 07 2011 *)

%o (PARI) c=s=0;forprime(p=2,1e5,f=factor(s+=p,p);f[,2]=apply(t->t<=p,f[,1]);write("/tmp/b132995.txt",c++" "factorback(f))) \\ _M. F. Hasler_, Mar 09 2014

%o (Haskell)

%o a132995 n = a132995_list !! (n-1)

%o a132995_list = tail $ f a000040_list 0 1 where

%o f (p:ps) u v = (gcd u v) : f ps (p + u) (p * v)

%o -- _Reinhard Zumkeller_, Mar 09 2014

%Y Cf. A007504, A002110.

%K nonn,look

%O 1,1

%A _Leroy Quet_, Nov 22 2007

%E More terms from _Emeric Deutsch_, Nov 24 2007