login
a(n) is the sum of all numbers that divide at least one of the composites between prime(n) and prime(n+1).
4

%I #21 Feb 05 2023 11:02:46

%S 7,12,42,28,75,39,106,214,72,289,202,96,230,429,471,168,544,362,195,

%T 631,429,749,1125,540,216,560,280,612,2557,679,1195,288,2169,372,1391,

%U 1378,830,1540,1479,546,2750,508,1025,468,3835,3900,1245,560,1262,1995,744,3576,2328,2195,2345,720,2449

%N a(n) is the sum of all numbers that divide at least one of the composites between prime(n) and prime(n+1).

%H Robert Israel, <a href="/A335579/b335579.txt">Table of n, a(n) for n = 2..10000</a>

%e For n=4, the composites between prime(4) and prime(5) are 8, 9, 10.

%e The numbers that divide at least one of these are {1,2,4,8} union {1,3,9} union {1,2,5,10} = {1,2,3,4,5,8,9,10}, and a(4) = 1+2+3+4+5+8+9+10 = 42.

%p f:= proc(n) local i,S;

%p S:= `union`(seq(numtheory:-divisors(i),i=ithprime(n)+1..ithprime(n+1)-1));

%p convert(S,`+`);

%p end proc:

%p map(f, [$2..100]);

%t a[n_] := Divisors /@ Range[Prime[n]+1, Prime[n+1]-1] // Flatten // Union // Total;

%t Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Feb 05 2023 *)

%o (PARI) a(n) = my(s=[]); for (c=prime(n)+1, prime(n+1)-1, s = setunion(s, divisors(c))); vecsum(s); \\ _Michel Marcus_, Jan 27 2021

%o (Python)

%o from sympy import prime, divisors

%o def a(n): return sum(set(d for c in range(prime(n)+1, prime(n+1)) for d in divisors(c)))

%o print([a(n) for n in range(2, 59)]) # _Michael S. Branicky_, Jul 12 2021

%Y Cf. A000040, A061120, A061141.

%K nonn,look

%O 2,1

%A _J. M. Bergot_ and _Robert Israel_, Jan 26 2021