OFFSET
1,1
COMMENTS
If, as seems quite probable, all the digits 1 to 9 are infinitely repeated in the sequence of natural roots of prime numbers, all the terms of A000040 are progressively deleted, hence the sequence should be a permutation of the natural numbers.
FORMULA
The digital root of A000040(1)=P(1) is 2, so we delete from this sequence p(2)=3 and assign the value 2 to a(1).
The digital root of the first term deleted is 3, so the second term we delete from the working sequence is the third one, i.e., 7, whose rank in A000040 is 4. Hence a(2)=4.
The digital root of the second term deleted is 7, so we delete from the working sequence its 7th term, i.e., 23, whose rank in A000040 is 9; hence a(3)=9; and so forth.
EXAMPLE
The digital root of the 3rd term deleted (23) is 5, so we delete from the working sequence the 5th term, i.e., 17, whose rank in A000040 is 7, which is the value that we assign to a(4).
MATHEMATICA
nmax=80; Clear[a, p, w]; dr[n_] := 1 + Mod[n-1, 9]; w[0] = Prime /@ Range[2nmax]; p[0]=2; a[n_] := (w[n] = DeleteCases[w[n-1], p[n] = w[n-1][[dr[p[n-1]]]]]; PrimePi[p[n]]); Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Aug 11 2017 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Philippe Lallouet (philip.lallouet(AT)orange.fr), Aug 03 2008
EXTENSIONS
More terms from Jean-François Alcover, Aug 12 2017
STATUS
approved