Results 1 to 16 of 16

Thread: (java)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jul:2009
    Location: Bulgaria
    Posts: 848

    (java)

    . , b - 2 b+1 .
    Code:
    int i = 2;
    		int b = 10000000;
    		while (b > 2) {
    			while ((i < b) && (b % i != 0)) {
    				if (i == b - 1) {
    					System.out.print(b + ",");
    				}
    				i++;
    			}
    			i=2;
    			b++;
    			}

    Code:
    int i = 2;
    		int b = 10000000;
    		while (b > 2) {
    			int c = b % 10;
    			if((c==1)||(c==3)||(c==7)||(c==9)){
    			while ((i < b) && (b % i != 0)) {
    				if (i == b - 1) {
    					System.out.print(b + ",");
    				}
    				i++;
    			}}
    			i=2;
    			b++;
    			}
    1,3,7,9 60% 15% eclipse, ?

    while ?
    Last edited by atom3; 1st December 2016 at 17:51.
    Alienware 17 R4, i7-6700hq, gtx-1060 OC, 16gb ddr4 2667 ram 256gb NVMe SSD, LSP, MMS, GPRS, UPS, FedEx, ZDR, kopr?, asl, W2F, ... .

  2. #2
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    , b b % i == 0 .
    : b b -= 2;

    , : .
    Last edited by anrieff; 1st December 2016 at 17:51.
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  3. #3
    Registered User
    Join Date: Jul:2009
    Location: Bulgaria
    Posts: 848
    - ,
    Last edited by atom3; 1st December 2016 at 18:03.
    Alienware 17 R4, i7-6700hq, gtx-1060 OC, 16gb ddr4 2667 ram 256gb NVMe SSD, LSP, MMS, GPRS, UPS, FedEx, ZDR, kopr?, asl, W2F, ... .

  4. #4
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    - (if (...), i++ ..).
    , , b % i, .. , .
    - ( ), : SQRT(b) - SQRT(b)
    .. for (int i = 2; i*i <= b; i++) ...
    (n3/2) , O(n2).

    - . - O(n log log n), .. .
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  5. #5
    Registered User
    Join Date: Aug:2016
    Location: Sofia
    Posts: 17
    . .
    , .. .
    , , .
    1, , .. 1, 3, 5, 7 9.

    , .

  6. #6
    Registered User
    Join Date: Jul:2009
    Location: Bulgaria
    Posts: 848
    Quote Originally Posted by dragi19 View Post
    . .
    , .. .
    , , .
    1, , .. 1, 3, 5, 7 9.

    , .
    ,
    if((c==1)||(c==3)||(c==7)||(c==9))
    5 . ? 15-16% ( 7-8 1% ), . , ...
    Last edited by atom3; 6th December 2016 at 16:20.
    Alienware 17 R4, i7-6700hq, gtx-1060 OC, 16gb ddr4 2667 ram 256gb NVMe SSD, LSP, MMS, GPRS, UPS, FedEx, ZDR, kopr?, asl, W2F, ... .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |