login
In the decimal expansion of Pi, positions of first digit of subsequences with total sum = 100.
2

%I #20 Mar 30 2020 05:43:48

%S 2,16,30,31,39,42,45,48,53,54,66,67,68,69,71,74,94,100,103,110,111,

%T 116,119,124,126,128,131,139,140,142,145,147,148,150,152,157,160,161,

%U 162,165,166,172,174,176,180,183,184,186,191,199,201,208,209,213,230,235

%N In the decimal expansion of Pi, positions of first digit of subsequences with total sum = 100.

%C Take decimal expansion of Pi, s = 3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2. Starting with the first term 3 add terms consecutively until we get sum = 100 or larger. If sum = 100 then a(1) = 3. It is impossible to get 100 this way. Then we try starting with second digit, 1. It happens that the subsequence from i = 2 to 21: s1 = {1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6} has a sum = 100, hence a(1) = 2. Next similar subsequence with sum = 100 has i = 16 to 37: s2 = {3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0,2,8,8,4}, hence a(2) = 16, etc.

%F a(n) = A109211(n) - A109212(n) + 1. [corrected by _Jinyuan Wang_, Mar 22 2020]

%o (PARI) default(realprecision, 101000); v=digits(floor(Pi*10^10^5));

%o lista(nn) = {my(x=21, s=103); for(k=2, nn, s-=v[k-1]; if(s==100, print1(k, ", "), while(s<100, s+=v[x++]); if(s==100, print1(k, ", ")))); } \\ _Jinyuan Wang_, Mar 22 2020

%Y Cf. A000796.

%Y Cf. A109211 (position of the final digit), A109212 (length of subsequence).

%K nonn,base,less

%O 1,1

%A _Zak Seidov_, Jun 22 2005