OFFSET
2,2
EXAMPLE
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.
PROG
(Python)
from sympy import nextprime
from math import gcd
from itertools import combinations
pr, terms = [2, 3], []
for i in range(100):
terms.append(len(set([gcd(t[0]+1, t[1]+1) for t in combinations(pr, 2)])))
pr.append(nextprime(pr[-1]))
print(terms)
(Python)
from math import gcd
from itertools import count, islice
from sympy import prime
def A358127_gen(): # generator of terms
a, b = [3], set()
for n in count(2):
q = prime(n)+1
b |= set(gcd(p, q) for p in a)
yield len(b)
a.append(q)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gleb Ivanov, Oct 30 2022
STATUS
approved