OFFSET
1,2
COMMENTS
Are 1 and 25 the only terms that are not primes?
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..430 (terms 1..150 from Robert Israel)
EXAMPLE
a(3) = 5 is a term because 5^2 = 25 = A086539(13).
MAPLE
R:= 1, 2: x:= 2: S:= 1: nS:= 1:
for n from 3 do
t:= ilcm(R[ceil(n/2).. n-1]);
for i from x+1 while igcd(i, t) <> 1 do od:
R:= R, i;
x:= i;
if issqr(i) then
nS:= nS+1; s:= sqrt(i); S:= S, s;
if nS = 100 then break fi
fi;
od:
S;
PROG
(Python)
from math import gcd
from itertools import count, islice
from sympy import integer_nthroot
def A373965_gen(): # generator of terms
alist, a, b = [1], 1, False
yield 1
while True:
for m in count(a+1):
if all(gcd(m, d) == 1 for d in alist):
if (x:=integer_nthroot(a:=m, 2))[1]: yield x[0]
alist = alist[(b:=not b):]+[a]
break
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Jun 23 2024
STATUS
approved