OFFSET
1,2
EXAMPLE
The primes in A104589 are 2, 5, 13, 97, ... with prime indices 1, 3, 6, 25, ...
MATHEMATICA
s[1] = 1; s[n_] := s[n] = s[n - 1] + Sum[If[CompositeQ[s[k]], 0, s[k]], {k, 1, n - 1}]; PrimePi[Select[s /@ Range[200], PrimeQ[#] &]] (* Amiram Eldar, Jul 21 2022 *)
PROG
(PARI) lista(nn) = my(last=1, s = 1, list = List()); for (n=2, nn, last += s; if (isprime(last), s += last; listput(list, primepi(last))); ); Vec(list);
(Python)
from sympy import isprime, primepi
from itertools import islice
def A355967_gen(): # generator of terms
a, b = 1, 1
while True:
a += b
if isprime(a):
b += a
yield primepi(a)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jul 21 2022
EXTENSIONS
a(14)-a(20) from Amiram Eldar, Jul 21 2022
a(21)-a(23) from Chai Wah Wu, Jun 03 2024
STATUS
approved