A098934 Numbers n such that the sum of the first n digits of Pi are divisible by n.
1, 2, 9, 11, 16
Offset: 1
Examples
a[1] = 1 since 3 is divisible by 1. a[2] = 2 since 3 + 1 = 4 is divisible by 2. a[3] != 3 since 3 + 1 + 4 = 8 is not divisible by 3.
Crossrefs
Cf. A046974.
Programs
-
Mathematica
$MaxPrecision = 2500000; pd = RealDigits[N[Pi, 2000000]][[1]]; s = 0; Do[s = s + pd[[n]]; If[ Mod[s, n] == 0, Print[n]], {n, 2000000}] (* Robert G. Wilson v, Oct 21 2004 *) Module[{nn=20,pid},pid=RealDigits[Pi,10,nn][[1]];Select[Range[nn],Mod[Total[Take[pid,#]],#]==0&]] (* Harvey P. Dale, Aug 30 2025 *)
Comments