login
Group the natural numbers such that the n-th group sum is divisible by prime(n): (1, 2, 3), (4, 5), (6, 7, 8, 9), (10, 11), (12, 13, 14, 15, 16, 17, 18, 19, 20, 21), ... Sequence contains the sum of the terms in the n-th group.
3

%I #17 Jun 09 2021 08:13:07

%S 6,9,30,21,165,234,238,38,690,522,2325,4107,4018,4988,564,9540,708,

%T 3172,9380,21726,8395,14615,1245,25365,11155,8585,1545,19795,55154,

%U 44070,78486,64714,1781,21684,102661,75047,14287,81011,190380,153624,249526,83079

%N Group the natural numbers such that the n-th group sum is divisible by prime(n): (1, 2, 3), (4, 5), (6, 7, 8, 9), (10, 11), (12, 13, 14, 15, 16, 17, 18, 19, 20, 21), ... Sequence contains the sum of the terms in the n-th group.

%H Michael S. Branicky, <a href="/A086491/b086491.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Zak Seidov)

%e a(4) = 10+11 = 21 is divisible by 7 = prime(4).

%t k = 0; Table[p = Prime[n]; k++; sm = 0; While[sm = sm + k; Mod[sm, p] > 0, k++]; sm, {n, 50}] (* _T. D. Noe_, Mar 19 2014 *)

%o (Python)

%o from itertools import count

%o from sympy import prime, primerange

%o def aupton(terms):

%o alst, naturals = [], count(1)

%o for p in primerange(1, prime(terms)+1):

%o s = next(naturals)

%o while s%p: s += next(naturals)

%o alst.append(s)

%o return alst

%o print(aupton(42)) # _Michael S. Branicky_, Jun 09 2021

%Y Cf. A086492, A086493.

%K nonn

%O 1,1

%A _Amarnath Murthy_, Jul 28 2003

%E More terms from _Ray Chandler_, Sep 16 2003