[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A309036
a(n) = gcd(A007504(n), A014285(n)).
4
2, 1, 1, 17, 2, 1, 1, 7, 2, 1, 1, 1, 2, 1, 1, 3, 4, 1, 1, 3, 8, 1, 1, 1, 20, 43, 1, 3, 4, 1, 1, 1, 28, 1, 1, 3, 2, 1, 1, 1, 2, 3, 107, 1, 4, 1, 1, 1, 2, 7, 1, 1, 10, 3, 1, 1, 30, 1, 1, 1, 2, 5, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 2, 1, 1, 1, 142, 1, 1, 3, 4, 1, 1, 11, 2, 1, 1, 1, 10
OFFSET
1,1
COMMENTS
a(n) is even if n == 1 (mod 4).
LINKS
FORMULA
a(n) = A007504(n)/A307716(n) = A014285(n)/A306834(n).
EXAMPLE
a(4) = gcd(2+3+5+7, 1*2+2*3+3*5+4*7) = gcd(17,51) = 17.
MAPLE
S1:= 0: S2:= 0:
for n from 1 to 100 do
p:= ithprime(n);
S1:= S1 + p;
S2:= S2 + n*p;
A[n]:= igcd(S1, S2);
od:
seq(A[i], i=1..100);
MATHEMATICA
GCD @@ # & /@ Rest@ Nest[Append[#1, {#1[[-1, 1]] + #3, #1[[-1, -1]] + #2 #3}] & @@ {#1, #2, Prime@ #2} & @@ {#, Length@ #} &, {{0, 0}}, 89] (* Michael De Vlieger, Jul 08 2019 *)
PROG
(PARI) a(n) = gcd(sum(k=1, n, prime(k)), sum(k=1, n, k*prime(k))); \\ Michel Marcus, Jul 09 2019
(Magma) p:=PrimesUpTo(1000); [Gcd(&+[p[j]:j in [1..m]], &+[j*p[j]:j in [1..m]]): m in [1..90]]; // Marius A. Burtea, Jul 09 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Jul 08 2019
STATUS
approved