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.

A351921 a(n) is the smallest nonzero number k such that gcd(prime(1)^k + 1, prime(2)^k + 1, ..., prime(n)^k + 1) > 1 and gcd(prime(1)^k + 1, prime(2)^k + 1, ..., prime(n+1)^k + 1) = 1.

This page as a plain text file.
%I A351921 #34 Apr 24 2022 10:17:09
%S A351921 2,26,21,86,33,1238,4401,4586,16161,18561,81,37046,85478,180146,339866
%N A351921 a(n) is the smallest nonzero number k such that gcd(prime(1)^k + 1, prime(2)^k + 1, ..., prime(n)^k + 1) > 1 and gcd(prime(1)^k + 1, prime(2)^k + 1, ..., prime(n+1)^k + 1) = 1.
%C A351921 Apparently, a(n) = (A307965(n+1) + 1)/2 - 1 for n>=3. - _Hugo Pfoertner_, Mar 02 2022
%t A351921 a[n_] := Module[{k = 1, p = Prime[Range[n + 1]]}, While[GCD @@ (Most[p]^k + 1) == 1 || GCD @@ (p^k + 1) > 1, k++]; k]; Array[a, 10, 2] (* _Amiram Eldar_, Feb 26 2022 *)
%o A351921 (Python)
%o A351921 from sympy import sieve
%o A351921 from math import gcd
%o A351921 from functools import reduce
%o A351921 sieve.extend_to_no(50)
%o A351921 pr = list(sieve._list)
%o A351921 terms = [0]*100
%o A351921 for i in range(2, 85478+1):
%o A351921     k,g,len_f = 1,2,0
%o A351921     while g != 1:
%o A351921         k += 1
%o A351921         len_f += 1
%o A351921         g = reduce(gcd, [t**i + 1 for t in pr[:k]])
%o A351921     if len_f > 1 and terms[len_f] == 0:
%o A351921         terms[len_f] = i
%o A351921 print(terms[2:15])
%o A351921 (PARI) isok(k, n) = my(v = vector(n+1, i, prime(i)^k+1)); (gcd(v) == 1) && (gcd(Vec(v, n)) != 1);
%o A351921 a(n) = my(k=1); while (!isok(k, n), k++); k; \\ _Michel Marcus_, Mar 18 2022
%Y A351921 Cf. A213052, A241043, A307965.
%K A351921 nonn,more
%O A351921 2,1
%A A351921 _Gleb Ivanov_, Feb 25 2022
%E A351921 a(15)-a(16) from _Jon E. Schoenfield_, Mar 01 2022