All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Digits of π in π^2 (Posted on 2023-04-27) Difficulty: 3 of 5
Where in the decimal representation of π^2 do the first N digits of π appear?

When I say "the first N digits of π", I mean counting the integer 3 but not counting the decimal point. For example, the first 5 digits of π are 31415.

Define the function pp2(N) as the N-th digit of π^2 where the first N digits of π are seen for the first time (after the decimal point).

So, pp2(1) = 13, because π^2 is approximately 9.869604401089358 and the first digit of pi, '3', first appears as the 13th digit after the decimal point.

Please find pp2(N) for N = 2,3,4,5.

See The Solution Submitted by Larry    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1
digits 400000
begin='314159';
p=char(vpa(pi)^2);
p=p(3:end);
for n=1:5
  pp2=strfind(p,begin(1:n));
  pp2=pp2(1);
  fprintf('%2d %6d %s\n',n,pp2,p(pp2-5:pp2+8))
end

finds

 N  pp2(N)  in context
               |
               v
 1     13 01089358618834
 2     37 51135313699407
 3    114 77402314407777
 4   7008 13824314152676
 5   7008 13824314152676
Going one farther:

digits 4000000
begin='314159';
p=char(vpa(pi)^2);
p=p(3:end);
for n=1:6
  pp2=strfind(p,begin(1:n));
  pp2=pp2(1);
  fprintf('%2d %6d %s\n',n,pp2,p(pp2-5:pp2+8))
end

 N  pp2(N)  in context
               |
               v
 1     13 01089358618834
 2     37 51135313699407
 3    114 77402314407777
 4   7008 13824314152676
 5   7008 13824314152676
 6 543623 14502314159763

  Posted by Charlie on 2023-04-27 08:56:35
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information