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.

A058938 Numbers k such that the sum of the first k digits of the decimal expansion of Pi is prime.

This page as a plain text file.
%I A058938 #16 Jul 02 2025 16:02:00
%S A058938 1,6,8,13,20,21,34,36,48,56,63,87,89,92,94,104,106,107,111,116,117,
%T A058938 118,120,130,132,133,141,146,147,162,170,173,179,183,185,186,198,202,
%U A058938 203,206,215,217,219,220,225,242,248,249,258,264,265,270,271,285,290,291
%N A058938 Numbers k such that the sum of the first k digits of the decimal expansion of Pi is prime.
%e A058938 6 is a term because 3 + 1 + 4 + 1 + 5 + 9 = 23, which is prime.
%p A058938 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 A058938 a = First[ RealDigits[ N[ Pi, 300]]]; Do[ If[ PrimeQ[Plus @@ Take[a, n]], Print[n]], {n, 1, 300}]
%t A058938 Flatten[Position[Accumulate[RealDigits[\[Pi],10,500][[1]]], _?PrimeQ]]  (* _Harvey P. Dale_, Apr 03 2011 *)
%Y A058938 Cf. A000796, A071117, A133213.
%K A058938 easy,nonn,base
%O A058938 1,2
%A A058938 _G. L. Honaker, Jr._, Jan 11 2001
%E A058938 More terms from _James Sellers_, Jan 14 2001