Results 1 to 2 of 2
  1. #1
    ajay.eeralla is offline Member
    Join Date
    Mar 2011
    Posts
    7
    Rep Power
    0

    Default how to implement legendre symbol in java

    i have a big integer n,
    now i want find construct factor base, ie. i have sieve {3,5,7,11...} are in integer array.
    now i have to construct factorbase by checking legendre symbol,
    i.e, to check wether n is quadratic residue modue 3 or 5 or 7....
    A number n is said to be quadratic residue modulo p, if there exist x belongs to zp suchthat x^2 =n(modp) ,
    iam unable to divide n by 3 or 5or 7...
    because n is biginteger and array is int.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by ajay.eeralla View Post
    iam unable to divide n by 3 or 5or 7...
    because n is biginteger and array is int.
    If a[k] is an int stored at position k of array a then new BigInteger(""+a[k]) is a BigInteger with the same value as a[k]. Do your calculations in the BigInteger domain using that value.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 9
    Last Post: 10-18-2008, 09:26 PM
  2. Replies: 3
    Last Post: 05-01-2008, 09:30 AM
  3. Using Java To Implement RSA Algorithm
    By Floetic in forum New To Java
    Replies: 3
    Last Post: 04-01-2008, 12:56 AM
  4. API to Implement Server SSH in JAVA
    By Jack in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 02:52 AM
  5. How can we implement IPC in java
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 07:38 AM

Posting Permissions

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