OFFSET
1,4
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..20000
FORMULA
EXAMPLE
PROG
(PARI) lista(nn) = my(c=4, t=0); print1("1, 1, 1"); forcomposite(k=4, nn, if(t%2, for(n=c, k-1, print1(", ", k)); c=k); t++); \\ Jinyuan Wang, Nov 29 2024
(Python)
from sympy import isprime
from itertools import count, islice
def nextcomposite(n): return next(k for k in count(n+1) if not isprime(k))
def agen(): # generator of terms
yield from [1, 1, 1]
c, c2 = 4, 6
for n in count(4):
if n == c2: c, c2 = c2, nextcomposite(nextcomposite(c2))
yield c2
print(list(islice(agen(), 70))) # Michael S. Branicky, Nov 29 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 14 2024
EXTENSIONS
More terms from Jinyuan Wang, Nov 29 2024
STATUS
approved