cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A358178 a(n) is the cardinality of the set of distinct pairwise gcd's of {1! + 1, ..., n! + 1}.

This page as a plain text file.
%I A358178 #16 Dec 16 2022 09:00:57
%S A358178 0,1,1,1,1,2,2,2,3,4,4,4,4,4,4,5,6,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,10,
%T A358178 10,11,12,12,12,13,14,14,15,15,15,15,16,16,16,16,16,17,17,17,17,17,17,
%U A358178 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18
%N A358178 a(n) is the cardinality of the set of distinct pairwise gcd's of {1! + 1, ..., n! + 1}.
%e A358178 For n = 6 initial set is {1+1, 2+1, 6+1, 24+1, 120+1, 720+1} and after applying gcd for each distinct pair of elements we get {1, 7} set with cardinality of a(6) = 2.
%o A358178 (Python)
%o A358178 from math import gcd, factorial
%o A358178 from itertools import combinations
%o A358178 f, terms = [2,], []
%o A358178 for i in range(2,100):
%o A358178     f.append(factorial(i)+1)
%o A358178     terms.append(len(set([gcd(*t) for t in combinations(f, 2)])))
%o A358178 print(terms)
%o A358178 (Python)
%o A358178 from math import gcd
%o A358178 from itertools import count, islice
%o A358178 def A358178_gen(): # generator of terms
%o A358178     m, f, g = 1, [], set()
%o A358178     for n in count(1):
%o A358178         m *= n
%o A358178         g |= set(gcd(d,m+1) for d in f)
%o A358178         f.append(m+1)
%o A358178         yield len(g)
%o A358178 A358178_list = list(islice(A358178_gen(),20)) # _Chai Wah Wu_, Dec 15 2022
%Y A358178 Cf. A038507, A358127, A356371, A214799.
%K A358178 nonn
%O A358178 1,6
%A A358178 _Gleb Ivanov_, Nov 02 2022