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.

A381116 Indices of composite terms in A381019.

This page as a plain text file.
%I A381116 #15 Feb 15 2025 13:58:39
%S A381116 7,13,16,23,30,36,47,55,63,64,79,91,100,113,123,142,149,167,178,196,
%T A381116 201,223,235,256,259,279,290,325,330,346,364,382,405,422,442,468,485,
%U A381116 488,530,534,541,583,605,630,631,665,674,682,729,735,790,798,847,854,862
%N A381116 Indices of composite terms in A381019.
%H A381116 Michael S. Branicky, <a href="/A381116/b381116.txt">Table of n, a(n) for n = 1..336</a>
%t A381116 nn = 1000; c[_] = False; u = v = 2; a[1] = 1;
%t A381116 Monitor[Reap[
%t A381116   Do[k = u;
%t A381116     While[Or[c[k],
%t A381116       ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ],
%t A381116       If[k > n - 1, k = v, k++]];
%t A381116     Set[{a[n], c[k]}, {k, True}];
%t A381116     If[CompositeQ[k], Sow[n]];
%t A381116     If[k == u, While[c[u], u++]];
%t A381116 If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* _Michael De Vlieger_, Feb 14 2025 *)
%o A381116 (Python)
%o A381116 from math import gcd
%o A381116 from sympy import isprime
%o A381116 from itertools import count, islice
%o A381116 def agen(): # generator of terms
%o A381116     alst, aset, an, m = [1], {1}, 1, 2
%o A381116     for n in count(2):
%o A381116         if an > 3 and not isprime(an):
%o A381116             yield n-1
%o A381116         an = next(k for k in count(m) if k not in aset and all(gcd(alst[-j], k) == 1 for j in range(1, min(k, n-1)+1)))
%o A381116         alst.append(an)
%o A381116         aset.add(an)
%o A381116         while m in aset: m += 1
%o A381116 print(list(islice(agen(), 55))) # _Michael S. Branicky_, Feb 14 2025
%Y A381116 Cf. A381019, A381115, A381117.
%K A381116 nonn
%O A381116 1,1
%A A381116 _N. J. A. Sloane_, Feb 14 2025