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

Home > Numbers
A series of primes equals N (Posted on 2018-10-19) Difficulty: 3 of 5
N=sum of primes between smallest and largest prime factor of N (inclusive).

Find all possible values for the composite number N below 300.

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
computer soln | Comment 1 of 2
We consider p(i) and p(j) where the composite number is 
p(i)p(j) = sum [ {n=i->j) p(n) ]
call these composites "duos"
or 
p(i)p(j)p(k) = sum [ {n=i->k} p(n) ]
call the composites "trios"

Going for composites made of 4 prime almost immediately exceeds
300 so we don't do it. 


rabbit-3:~ lord$ hh

 duos

        p(i)         p(j)        product   sum 

           2           5          10          10

           3          13          39          39

           5          31         155         155

 trios

  none 

rabbit-3:~ lord$ more hh.f

        program pp

        implicit none

        integer cnt,i,j,k,l,n,p(48),duo,trio,sum

        open(2,file='primes1.txt',status='old')

           do i=1,6

           j=8*i-7

           read(2,*)(p(l),l=j,j+7)

           enddo

       print*,'duos'

          do 1 i=1,44

                do j=i+1,45

                sum=0

                duo=p(i)*p(j)

                if(duo.gt.300)go to 1

                        do n=i,j

                        sum=sum+p(n)

                        enddo

                   if(sum.eq.duo)print*,p(i),p(j),duo,sum

                enddo

1          enddo

        print*,'trios'

        cnt=0

           do 2 i=1,43

                do j=i+1,44

                if(p(i)*p(j).gt.300) go to 2

                   do k=j+1,45

                   sum=0

                   trio=p(i)*p(j)*p(k)

                   if(trio.gt.300)go to 3

                        do n=i,k

                        sum=sum+p(n)

                        enddo

                           if(trio.eq.sum)then

                           cnt=cnt+1

                           print*,p(i),p(j),p(k),trio,sum

                           endif

                   enddo

3               enddo

2          enddo

        if(cnt.eq.0)print*,' none '

        end


Edited on October 19, 2018, 8:07 am
  Posted by Steven Lord on 2018-10-19 08:04:55

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