11105 - Semi-prime H-numbers

All about problems in Volume 111. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

coolguy
New poster
Posts: 30
Joined: Tue Oct 17, 2006 5:59 pm

11105 - Semi-prime H-numbers

Post by coolguy »

according to my code the number of H primes in the range is 89070 and number of H semi primes is 117965 ........am i right ?? can anyone please verify .............
waiting to be helped ....
In good company
david
Learning poster
Posts: 83
Joined: Mon Apr 21, 2003 10:14 pm

Post by david »

There are 89070 h-primes and 105753 h semi-primes in the range allowed.
coolguy
New poster
Posts: 30
Joined: Tue Oct 17, 2006 5:59 pm

11105ac

Post by coolguy »

thank u david for ur reply . i got it ac . i was counting repeats . now i maintain a set and get ac ..
bye bye :)
In good company
cytmike
Learning poster
Posts: 95
Joined: Mon Apr 26, 2004 1:23 pm
Location: Hong Kong and United States
Contact:

Post by cytmike »

Anybody knows a more efficient way to do this?
My code gets AC in 9.97s ....
Impossible is Nothing.
helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo »

cytmike wrote:Anybody knows a more efficient way to do this?
My code gets AC in 9.97s ....
I did something like sieve..
It runs 0.104 sec..
chinmoy kanti dhar
New poster
Posts: 19
Joined: Fri Jun 22, 2007 6:17 pm
Location: bangladesh

help me.....

Post by chinmoy kanti dhar »

how can i determine a H prime.Is 49 is a H prime?plz help me by giving first 20 H prime.....
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Re: help me.....

Post by Jan »

chinmoy kanti dhar wrote: 1. how can i determine a H prime. Is 49 is a H prime?
2. plz help me by giving first 20 H prime.....
1. Modified sieve will do.

2. The first 20 Hprime are...

Code: Select all

5 9 13 17 21 29 33 37 41 49 53 57 61 69 73 77 89 93 97 101
Hope these help.
Ami ekhono shopno dekhi...
HomePage
jainal cse du
New poster
Posts: 23
Joined: Thu Jul 27, 2006 2:43 pm
Location: University of Dhaka,Bangladesh

Post by jainal cse du »

Code: Select all

Yes, Now I got AC.
code removed
lucky16g
New poster
Posts: 8
Joined: Sun Jul 01, 2007 7:25 pm

Post by lucky16g »

for sample input
789
i got ans 64
follower are my 64 H-semi-primes
can anyone tell me which two are not H-semi-primes
1 ) 5 5 =25
2 ) 5 9 =45
3 ) 5 13 =65
4 ) 5 17 =85
5 ) 5 21 =105
6 ) 5 29 =145
7 ) 5 33 =165
8 ) 5 37 =185
9 ) 5 41 =205
10 ) 5 49 =245
11 ) 5 53 =265
12 ) 5 57 =285
13 ) 5 61 =305
14 ) 5 69 =345
15 ) 5 73 =365
16 ) 5 77 =385
17 ) 5 89 =445
18 ) 5 93 =465
19 ) 5 97 =485
20 ) 5 101 =505
21 ) 5 109 =545
22 ) 5 113 =565
23 ) 5 121 =605
24 ) 5 129 =645
25 ) 5 133 =665
26 ) 5 137 =685
27 ) 5 141 =705
28 ) 5 149 =745
29 ) 5 157 =785
30 ) 9 9 =81
31 ) 9 13 =117
32 ) 9 17 =153
33 ) 9 21 =189
34 ) 9 29 =261
35 ) 9 33 =297
36 ) 9 37 =333
37 ) 9 41 =369
38 ) 9 49 =441
39 ) 9 53 =477
40 ) 9 57 =513
41 ) 9 61 =549
42 ) 9 69 =621
43 ) 9 73 =657
44 ) 9 77 =693
45 ) 13 13 =169
46 ) 13 17 =221
47 ) 13 21 =273
48 ) 13 29 =377
49 ) 13 33 =429
50 ) 13 37 =481
51 ) 13 41 =533
52 ) 13 49 =637
53 ) 13 53 =689
54 ) 13 57 =741
55 ) 17 17 =289
56 ) 17 21 =357
57 ) 17 29 =493
58 ) 17 33 =561
59 ) 17 37 =629
60 ) 17 41 =697
61 ) 21 21 =441
62 ) 21 29 =609
63 ) 21 33 =693
64 ) 21 37 =777
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

You are counting 441 and 693 twice!
Ami ekhono shopno dekhi...
HomePage
lucky16g
New poster
Posts: 8
Joined: Sun Jul 01, 2007 7:25 pm

Post by lucky16g »

thanks for your debug
there's very helfull for me
thanks a lot!!!
lnr
Experienced poster
Posts: 142
Joined: Sat Jun 30, 2007 2:52 pm
Location: Dhaka,Bangladesh

11105 - Semi-prime H-numbers

Post by lnr »

5=5*1 so it is not a semi prime.
1 is unit.
lnr
Experienced poster
Posts: 142
Joined: Sat Jun 30, 2007 2:52 pm
Location: Dhaka,Bangladesh

11105 - Semi-prime H-numbers

Post by lnr »

What is the difference between H-primes and H-semi-primes?
sazzadcsedu
Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Location: narayangong,bangladesh.
Contact:

11105 - Semi-prime H-numbers

Post by sazzadcsedu »

how to determine a particular number is only multiple of 2 number!!!
plz some give me some idea;
i remove number containing more than 2-(5,9,13,17.....)
but cant handle case like:-5*117=(5*9*17).
how to handle them?????
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Re: 11105 - Semi-prime H-numbers

Post by helloneo »

You can try a similar but little bit easier problem..

http://icpcres.ecs.baylor.edu/onlinejud ... 10856.html

If you don't know about factorization very well, there are also good problems to learn it..

http://icpcres.ecs.baylor.edu/onlinejud ... 1/160.html
http://icpcres.ecs.baylor.edu/onlinejud ... 5/583.html
http://icpcres.ecs.baylor.edu/onlinejud ... 10699.html
Post Reply

Return to “Volume 111 (11100-11199)”