cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A038194 Iterated sum-of-digits of n-th prime; or digital root of n-th prime; or n-th prime modulo 9.

This page as a plain text file.
%I A038194 #60 Dec 12 2024 09:29:06
%S A038194 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,
%T A038194 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,
%U A038194 5,7,2,8,7,4,1,5,2,1,5,4,5,7,8,1,7,2,8
%N A038194 Iterated sum-of-digits of n-th prime; or digital root of n-th prime; or n-th prime modulo 9.
%C A038194 Integers with iterated sum-of-digits 3, 6 or 9 are divisible by 3, so 3 is the only prime with iterated sum-of-digits 3 and there are no primes with iterated sum-of-digits 6 or 9.
%C A038194 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
%C A038194 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 Granville-Martin link. - _Robert Israel_, Jul 08 2015
%H A038194 Nathaniel Johnston, <a href="/A038194/b038194.txt">Table of n, a(n) for n = 1..10000</a>
%H A038194 Andrew Granville and Greg Martin, <a href="https://www.arxiv.org/abs/math/0408319">Prime number races</a>, arXiv:math/0408319 [math.NT], 2004
%F A038194 a(n) = A010888(A000040(n)).
%F A038194 Sum_k={1..n} a(k) ~ (9/2)*n. - _Amiram Eldar_, Dec 11 2024
%e A038194 Prime(5) = 11, 1 + 1 = 2 hence a(5) = 2.
%e A038194 a(297)=7 because the 297th prime is 1951 and 1+9+5+1 = 16 -> 1+6 = 7.
%p A038194 A038194 := proc(n) return ithprime(n) mod 9: end: seq(A038194(n), n=1..100); # _Nathaniel Johnston_, May 04 2011
%t A038194 Table[Mod[Prime[n], 9], {n, 200}]
%t A038194 Mod[Prime[Range[100]], 9] (* _Vincenzo Librandi_, May 06 2014 *)
%o A038194 (PARI) forprime(p=2,600,print1(p%9,","))
%o A038194 (Magma) [p mod 9: p in PrimesUpTo(500)]; // _Vincenzo Librandi_, May 06 2014
%o A038194 (Haskell)
%o A038194 a038194 = flip mod 9 . a000040  -- _Reinhard Zumkeller_, Dec 10 2014
%Y A038194 Cf. A007605, A010888, A061237 - A061242, A139413, A153110.
%K A038194 nonn,base,easy
%O A038194 1,1
%A A038194 Den Roussel (DenRoussel(AT)webtv.net) and _Clark Kimberling_
%E A038194 Edited by _Klaus Brockhaus_, Feb 16 2002
%E A038194 Edited at the suggestion of _R. J. Mathar_ by _N. J. A. Sloane_, May 14 2008