[go: up one dir, main page]

login
Alternate adding and multiplying prime numbers: a(2n) = a(2n-1) * prime(2n+1) and a(2n-1) = a(2n) + prime(2n-2) for n >= 1.
3

%I #24 Mar 21 2023 12:13:08

%S 5,25,32,352,365,6205,6224,143152,143181,4438611,4438648,181984568,

%T 181984611,8553276717,8553276770,504643329430,504643329491,

%U 33811103075897,33811103075968,2468210524545664,2468210524545743,204861473537296669,204861473537296758

%N Alternate adding and multiplying prime numbers: a(2n) = a(2n-1) * prime(2n+1) and a(2n-1) = a(2n) + prime(2n-2) for n >= 1.

%e a(1) = 2 + 3 = 5;

%e a(2) = 5 * 5 = 25;

%e a(3) = 25 + 7 = 32;

%e ...

%e a(40) = 2714410084880275101596278688487175846.

%o (Python)

%o from sympy import primerange

%o p = list(primerange(1, 200))

%o def a(n):

%o out = p[0] + p[1]

%o for i in range(1, n):

%o if i % 2:

%o out *= p[i + 1]

%o else:

%o out += p[i + 1]

%o return out

%o for n in range(1, 25):

%o print(a(n), end=", ")

%Y Cf. A047905, A047904, A077138, A222559, A332659, A332660.

%K nonn,easy

%O 1,1

%A _Adnan Baysal_, Feb 18 2020