login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A058938 Sum of first n digits of decimal expansion of pi is prime. 1

%I

%S 1,6,8,13,20,21,34,36,48,56,63,87,89,92,94,104,106,107,111,116,117,

%T 118,120,130,132,133,141,146,147,162,170,173,179,183,185,186,198,202,

%U 203,206,215,217,219,220,225,242,248,249,258,264,265,270,271,285,290,291

%N Sum of first n digits of decimal expansion of pi is prime.

%e a(2) = 6 because 3 + 1 + 4 + 1 + 5 + 9 = 23, which is prime.

%p Digits := 2000: it := evalf(Pi, 2000): for i from 1 to 2000 do a[i] := floor(it): it := 10*(it-floor(it)): od: s := 0: for i from 1 to 2000 do s := s+a[i]: if isprime(s) then printf(`%d,`,i) fi: od:

%t a = First[ RealDigits[ N[ Pi, 300]]]; Do[ If[ PrimeQ[Plus @@ Take[a, n]], Print[n]], {n, 1, 300}]

%t Flatten[Position[Accumulate[RealDigits[\[Pi],10,500][[1]]], _?PrimeQ]] (* _Harvey P. Dale_, Apr 03 2011 *)

%Y Cf. A000796, A071117, A133213.

%K easy,nonn,base

%O 1,2

%A _G. L. Honaker, Jr._, Jan 11 2001

%E More terms from _James A. Sellers_, Jan 14 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 20:16 EDT 2019. Contains 323426 sequences. (Running on oeis4.)