OFFSET
1,1
COMMENTS
If p is in the sequence, its index A000720(p) is not divisible by 3. - Robert Israel, Sep 19 2017
EXAMPLE
The prime-index of 11 is 5: 5+5=10, 10+1+0=11 -> after two iterations you reach 11, so 11 is in the sequence.
MAPLE
f:= proc(n) local t, p;
p:= ithprime(n);
t:= n;
do
t:= t + convert(convert(t, base, 10), `+`);
if t > p then return NULL
elif t = p then return p
fi
od;
end proc:
map(f, [$1..1000]); # Robert Israel, Sep 19 2017
MATHEMATICA
ok[p_] := Block[{n = PrimePi@ p}, While [n < p, n += Total@ IntegerDigits@ n]; n == p]; Select[Prime@ Range@ 600, ok] (* Giovanni Resta, Sep 19 2017 *)
PROG
(PARI) is(n) = my(x=primepi(n)); while(1, x=x+sumdigits(x); if(x==n, return(1), if(x > n, return(0))))
forprime(p=1, 7000, if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Sep 19 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Peter Weiss, Sep 19 2017
EXTENSIONS
More terms from Felix Fröhlich, Sep 19 2017
STATUS
approved