

A038194


Iterated sumofdigits of nth prime; or digital root of nth prime; or nth prime modulo 9.


45



2, 3, 5, 7, 2, 4, 8, 1, 5, 2, 4, 1, 5, 7, 2, 8, 5, 7, 4, 8, 1, 7, 2, 8, 7, 2, 4, 8, 1, 5, 1, 5, 2, 4, 5, 7, 4, 1, 5, 2, 8, 1, 2, 4, 8, 1, 4, 7, 2, 4, 8, 5, 7, 8, 5, 2, 8, 1, 7, 2, 4, 5, 1, 5, 7, 2, 7, 4, 5, 7, 2, 8, 7, 4, 1, 5, 2, 1, 5, 4, 5, 7, 8, 1, 7, 2, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Integers with iterated sumofdigits 3, 6 or 9 are divisible by 3, so 3 is the only prime with iterated sumofdigits 3 and there are no primes with iterated sumofdigits 6 or 9.
The remaining values are very evenly distributed: these are the number of appearances in the first 1007933 primes: 1:167878; 2:168079; 4:167984; 5:168027; 7:167906; 8:168058.  Carmine Suriano, Jun 22 2015
Asymptotically, the ratios (number of primes <= n and == i mod 9)/(number of primes <= n and == j mod 9) go to 1 as n > infinity for all i,j in {1,2,4,5,7,8} by the Prime Number Theorem for Arithmetic Progressions. For more detailed analysis, see the GranvilleMartin link.  Robert Israel, Jul 08 2015


LINKS

Nathaniel Johnston, Table of n, a(n) for n = 1..10000
A. Granville and G. Martin, Prime number races, arXiv:math/0408319 [math.NT], 2004


EXAMPLE

Prime(5) = 11, 1 + 1 = 2 hence a(5) = 2.
a(297)=7 because the 297th prime is 1951 and 1+9+5+1 = 16 > 1+6 = 7.


MAPLE

A038194 := proc(n) return ithprime(n) mod 9: end: seq(A038194(n), n=1..100); # Nathaniel Johnston, May 04 2011


MATHEMATICA

Table[Mod[Prime[n], 9], {n, 200}]
Mod[Prime[Range[100]], 9] (* Vincenzo Librandi, May 06 2014 *)


PROG

(PARI) forprime(p=2, 600, print1(p%9, ", "))
(MAGMA) [p mod 9: p in PrimesUpTo(500)]; // Vincenzo Librandi, May 06 2014
(Haskell)
a038194 = flip mod 9 . a000040  Reinhard Zumkeller, Dec 10 2014


CROSSREFS

Cf. A007605, A010888, A061237  A061242, A139413, A153110.
Sequence in context: A076779 A074464 A074463 * A111309 A007605 A077765
Adjacent sequences: A038191 A038192 A038193 * A038195 A038196 A038197


KEYWORD

nonn,base,easy


AUTHOR

Den Roussel (DenRoussel(AT)webtv.net) and Clark Kimberling


EXTENSIONS

Edited by Klaus Brockhaus, Feb 16 2002
Edited at the suggestion of R. J. Mathar by N. J. A. Sloane, May 14 2008


STATUS

approved



