Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7821261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:35:09+00:00 2026-06-02T07:35:09+00:00

I have an equation that I need to write in BigInteger format. It needs

  • 0

I have an equation that I need to write in BigInteger format. It needs to be in a for loop. This is what I have so far, but I’m not sure how to use BigInteger with it. This is the equation written to be in the for loop: i*(i+1)*(2*i+1)*(3*i*i+3*i-1)/30

public static BigInteger[] nthtetranum(int n) //This is the method using the simple formula for tetra number.
{

    BigInteger[] nth = new BigInteger[n];

    for(int i = 0; i <nth.length; i++)
    {
        //nth[i] = i*(i+1)*(2*i+1)*(3*i*i+3*i-1)/30;
        nth[i] = 

    }
    return nth;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:35:11+00:00Added an answer on June 2, 2026 at 7:35 am
    BigInteger two = new BigInteger("2");
    BigInteger three = new BigInteger("3");
    BigInteger I = new BigInteger(""+i); // "I" is a bigint version of "i"
    nth[i] = I
        .multiply(I.add(BigInteger.ONE))
        .multiply(I.multiply(two).add(BigInteger.ONE))
        .multiply(I.multiply(I).multiply(three).add(I.multiply(three)).subtract(BigInteger.ONE))
        .divide(new BigInteger("30"));
    

    This expression is ugly, but it would not overflow even for “borderline” values of i.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an equation of a curve that i need to draw like: ((X^z)-1)/z
I suspect that I will shortly have a need to write an integration library
This is what I need to do- I have this equation- Ax = y
So I have an equation like this: I need to get G[xy] . How
I have a class that solves an equation using an approximation, evaluates the approximation
I have a complex js function with an equation in which I actually need
I have some differential equations that I need to solve using MATLAB's ODE solvers.
I use CSS transitions pretty frequently now but find it limiting to only have
I have many 3D planes. The thing that I need to know is the
The background for asking this question is that I am solving a linearized equation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.