OFFSET
1,1
COMMENTS
Consider the sequence P_0 of primes (A000040).
The simplest algorithm giving this sequence is the sieve of Eratosthenes. If we already know primes 2,3,...,p_n, then, by the algorithm of this sieve, the remaining numbers are not divisible by 2,3,...,p_(n-1)and to obtain p_(n+1) we should remove all remaining numbers divisible by p_n.
Note that we can also say that we remove all remaining numbers k for which GCD(k,p_n)>1. Although for generating the primes the algorithm is unchanged, in this form the algorithm we will apply in more general cases. Denote this algorithm by E*.
Remove 1 and the primes from the positive numbers. We get sequence
4,6,8,9,10,12,14,15,16,18,20,21,22,24,... (1)
By algorithm E*, keeping 4, we remove all even numbers; further keeping 4,9, we remove numbers divisible by 3, etc. We obtain sequence 4,9,25,49,...consisting of squares of primes (A001248). Denote this sequence by P_1. Removing P_1 from (1), we obtain sequence
6,8,10,12,14,15,16,18,20,21,22,24,26,... (2)
By algorithm E*, keeping 6, we remove all numbers divisible by 2 and 3; the least ramaning number is 35; keeping 6 and 35, we remove further all numbers divisible by 5 and 7, etc. We obtain sequence 6,35,143,...
(A089581). Denote this sequence by P_2.
FORMULA
a(n) = prime(2*n-2)*prime(2*n-1), n>1, a(1)=8. - Bill McEachen, Nov 26 2024
MATHEMATICA
k = 3; {2 (k + 1)}~Join~Map[Times @@ # &, Partition[Prime@ Range[k - 1, 78], 2, 2]] (* Michael De Vlieger, Jul 21 2016 *)
PROG
(PARI) a(n)=if(n==1, 8, prime(2*n-2)*prime(2*n-1)) \\ Bill McEachen, Nov 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, Jul 21 2016
STATUS
approved