login
a(n) is the cardinality of the set of pairwise gcd's of {prime(1)+1, ..., prime(n)+1}.
1

%I #14 Nov 02 2022 11:53:24

%S 1,3,4,5,5,5,5,7,8,8,8,9,9,11,12,14,14,14,14,14,14,15,15,15,16,16,18,

%T 19,20,21,22,22,23,23,23,23,23,24,24,26,27,29,29,30,32,32,33,35,36,36,

%U 37,37,37,37,38,38,39,39,39,39,40,40,42,42,43,43,43,44,45,45,48,48,48,48,50,50,50,50

%N a(n) is the cardinality of the set of pairwise gcd's of {prime(1)+1, ..., prime(n)+1}.

%e For n = 3 initial set is {2+1, 3+1, 5+1} and after applying gcd for each distinct pair of elements we get {1, 2, 3} set with cardinality of a(3) = 3.

%o (Python)

%o from sympy import nextprime

%o from math import gcd

%o from itertools import combinations

%o pr, terms = [2,3], []

%o for i in range(100):

%o terms.append(len(set([gcd(t[0]+1, t[1]+1) for t in combinations(pr,2)])))

%o pr.append(nextprime(pr[-1]))

%o print(terms)

%o (Python)

%o from math import gcd

%o from itertools import count, islice

%o from sympy import prime

%o def A358127_gen(): # generator of terms

%o a, b = [3], set()

%o for n in count(2):

%o q = prime(n)+1

%o b |= set(gcd(p,q) for p in a)

%o yield len(b)

%o a.append(q)

%o A358127_list = list(islice(A358127_gen(),100)) # _Chai Wah Wu_, Nov 02 2022

%Y Cf. A008864, A356371, A214799.

%K nonn

%O 2,2

%A _Gleb Ivanov_, Oct 30 2022