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

    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
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power


    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,

    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  2. Replies: 3
    Last Post: 05-01-2008, 08:30 AM
  3. Using Java To Implement RSA Algorithm
    By Floetic in forum New To Java
    Replies: 3
    Last Post: 03-31-2008, 11:56 PM
  4. API to Implement Server SSH in JAVA
    By Jack in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 01:52 AM
  5. How can we implement IPC in java
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 06: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