A381116 Indices of composite terms in A381019.
7, 13, 16, 23, 30, 36, 47, 55, 63, 64, 79, 91, 100, 113, 123, 142, 149, 167, 178, 196, 201, 223, 235, 256, 259, 279, 290, 325, 330, 346, 364, 382, 405, 422, 442, 468, 485, 488, 530, 534, 541, 583, 605, 630, 631, 665, 674, 682, 729, 735, 790, 798, 847, 854, 862
Offset: 1
Keywords
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..336
Programs
-
Mathematica
nn = 1000; c[_] = False; u = v = 2; a[1] = 1; Monitor[Reap[ Do[k = u; While[Or[c[k], ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ], If[k > n - 1, k = v, k++]]; Set[{a[n], c[k]}, {k, True}]; If[CompositeQ[k], Sow[n]]; If[k == u, While[c[u], u++]]; If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Feb 14 2025 *)
-
Python
from math import gcd from sympy import isprime from itertools import count, islice def agen(): # generator of terms alst, aset, an, m = [1], {1}, 1, 2 for n in count(2): if an > 3 and not isprime(an): yield n-1 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))) alst.append(an) aset.add(an) while m in aset: m += 1 print(list(islice(agen(), 55))) # Michael S. Branicky, Feb 14 2025
Comments