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

Home > Numbers > Sequences
Terrific sequence 3 (Posted on 2024-02-04) Difficulty: 3 of 5
3141, 0582, ____, 2796, 6549, ____...

No Solution Yet Submitted by Math Man    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
soln Comment 4 of 4 |
And just as night follows the day - here are 4-digit patterns 
seen in the digits of pi for the first time, the second time, etc, 
as one scans the digits.    

           1        3141
           2        0582
           3        9999
           4        2796
           5        6549
           6        2019

The program is below. 

I am unhappy because this challenge enticed me to break my New Year's resolution of sticking to the deeper problems. :-) 

        program pi
        implicit none
        integer cntmax,pattern,i,j,p(10000),cnt(0:9999)
        data cnt/10000*0/
        open(2,file='pi.txt',status='old')
        cntmax=0
           read(2,3)(p(i),i=1,10000)
3          format(10000i1)
           do j=1,9997
           pattern=1000*p(j)+100*p(j+1)+10*p(j+2)+p(j+3)
           cnt(pattern)=cnt(pattern)+1
                if(cnt(pattern).gt.cntmax)then
                print*,cnt(pattern),pattern
                cntmax=cnt(pattern)
                if(cntmax.eq.6)call exit
                endif
           enddo
        end


  Posted by Steven Lord on 2024-02-12 03:19:21
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 (0)
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