\\ Kevin Ryde, March 2022 \\ \\ Usage: gp >1,x, p[x]*p[n-x]))); ret; } \\ This code is per the formula in the sequence \\ \\ a(n) = Min_{x+y=n} prime(a(x))*prime(a(y)) \\ \\ Each prime(a(i)) is used repeatedly for products so they're held in the \\ p[] vector. For term n, primes p[1]..p[n-1] are rquired so p[] is filled \\ "one behind". \\ \\ x and y are symmetric in their roles so it suffices to consider x <= y, \\ which means x <= n/2, so x=1 to x=floor(n/2) inclusive. \\ \\ The code is limited by the prime() function on ever larger arguments. \\ On a 32-bit system and PARI circa 2.13, the largest practical is n=13 \\ (but is fast with a big enough "primelimit"). { my(vec = a_vector(8)); print1("A352456 = "); for(i=1,#vec, print1(vec[i],",")); print("..."); } print("end");