ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Programming :: Program Ideas :: Math Program Ideas
Math Program Ideas

Post your ideas for new math programs here, or build on ideas posted by other visitors.

  Reply to this item

Pi(x)
danbert23  Account Info

I am thinking of creating a program that finds the number of primes less than or equal to a number x (in other words, pi(x)). I realize that there is an 89 assembly program that does this, but I want to find a way without just counting the primes from 2 to x. I have found a couple of formulae in a book, but none is exact. Here they are:

Pi(x) = x/ln x \\this is generally lower than pi(x)

Pi(x) = Li(x) \\Li(x)=the integral of 1/ln x from either 0 or 2 to x (two different definitions are in use)

Pi(x) = li(x)+O(sqrt x * ln x) \\in other words, li(x) + some number less than sqrt x * ln x

I am beginning to think that the best way to do this is just to use x/ln x, add something to it (random?) and give a margin of error (which has been proven to always be less than 10%)

Help?

     29 July 2004, 21:25 GMT

Re: Pi(x)
danbert23  Account Info

I found another formula, but it involves the zeros of Riemann's zeta function. For the curious:

Pi(x)=J(x) - 1/2 J(x^.5) - 1/3 J(x^(1/3) . . .
where
J(x)=Li(x) - ln 2 + integral(1/((t^2-1)*t*ln x),t,x,infinity) - sum(Li(x^p),p)
where:
Li(x) represents the integral of ln x from 0 to infinity;
integral(1/((t^2-1)*t*ln x),t,x,infinity) is the integral of 1/(((t^2-1)*t*ln x) from x to infinity with respect for t. This is always less than .01, so rounding gets rid of it;
sum(Li(x^p),p) represents the sum of the ln integral of x^p, with p being the zeroes of Riemann's zeta function.

     8 August 2004, 19:28 GMT

Re: Pi(x)
solafide  Account Info
(Web Page)

Use a for() that loops through all odd numbers and checks each of them for primeness.

     1 March 2005, 23:04 GMT


Re: Pi(x)
Justin LeBeau  Account Info

I came across a more accurate formula than the pi(x)=x/ln(x). It is more accurate for most of the numbers greater than 5000 and tested so far up to 30 trillion or 30,000,000,000,000 and is off by less than 1/4% at this limit. It is above the correct number, but relative error is less than that of x/ln(x).
This formula is:

pi(x)= (2xlog(x)+x)/(2log(x)ln(x))

You can also estimate ln(x) by solving for ln(x) and getting:

ln(x)=(2xlog(x)+x)/(2log(x)pi(x))

     6 April 2005, 12:56 GMT

Re: Math Program Ideas
Bob Leonard  Account Info

I'm making a massive stats program that currently contains 133 stats definitions and I plan on adding impotant equations and calculators to instantly solve these equations for you. I have seperated the definitions into several loader files that are just regular programs, that are about 15kbs each. Only one file can be unarchived at a time. And I have a main program that unarchives the correct loader file when it is to be used and then archives them afterward. However, the problem is that the I get an ivalid error when the main program tries to unarchive any of the loader files. However I can go into [2nd] memory and unarchive the files. And, when I delete out hte unarchive command in the main program and unarchive the program before running it, the program works correctly. If anyone could tell me why this INVALID ERROR might be occurring I would greatly appreciate it.

     3 August 2004, 05:24 GMT


Re: Re: Math Program Ideas
Xeno_Cre8or Account Info

could it be that you aren't using the Asm(prgmNAME) notation? Or mabye you are using that, but prgmNAME isn't an ASM program.

     1 September 2009, 01:21 GMT

Re: Math Program Ideas
Peter Xu  Account Info

Hi everyone...i was wondering if anyone know how to make a program that expands functions (ex. (a+b)(a-b) to a^2-b^2)?? I kind of got an idea but don't know now to start this program.

     11 August 2004, 05:52 GMT

Re: Re: Math Program Ideas
TI_fan Account Info
(Web Page)

There is a program in the archives that multiplies polynomials and is for the TI-83 Plus. Do a search for it.

     8 November 2004, 22:17 GMT


Re: Re: Math Program Ideas
m85476585  Account Info

I made a FOIL frogram, which is similar.

:ClrHome
Disp "(Ax+B)(Cx+D)"
Prompt A,B,C,D
A*C->F
A*D->O
B*C->I
B*D->L
O+!->M
ClrHome
Output(1,1,F)
Output(1,4,"x^2")
Output(1,6,"+")
Output(1,7,M)
Output(1,10,"x"
Output(1,11,"+")
Output(1,12,L)
Disp ""
Pause
Stop

     16 January 2005, 16:06 GMT


Re: Re: Re: Math Program Ideas
Trance Account Info

Hello,

I have also made a FOIL program for the TI-83+, which I feel is much simpler than yours.

: Prompt A,B,C,D
: (A+B)(C+D)
AC->E
AD+BC->F
BD->G
Disp E,F,G

Enjoy,
Trance

     21 January 2005, 00:51 GMT


Re: Re: Re: Re: Math Program Ideas
brandon fritz  Account Info

can you do this with problems s/a (2x+2)(x-1) ?

otherwise this is pointless

     11 December 2006, 21:46 GMT

Decimal points!
Murphy Davis  Account Info

I am a learning programmer making programs for my peers, and i was wondering if anyone had any ideas on how to chop off decimal points or how to count the number of decimal points in a program without having to ask the program user as i am trying to make intuitive, user-friendly programs (my classmates aren't especially tech savvy). If it makes any diff whatsoever, i am using a ti-84 silver with os 2.21

     16 August 2004, 21:04 GMT


Re: Decimal points!
Chivo  Account Info

Here's a general algorithm for finding how many decimal digits a number has after the decimal point (which is what I assume you mean by "decimal points"):

0. set the digit counter to zero
3. take away the whole part of the number (use Int or something)
1. if it is zero, then you're done
2. multiply it by 10
3. take away the whole part of the number
4. increment the digit counter
5. go to 1.

That would translate to something like

(where N is the number)
:0->D
:N-Int(N)->N
:While N
:10*N->N
:N-Int(N)->N
:D+1->D
:End

You probably could find a way to make it smaller and faster.

Finding the number of digits to the *left* of the decimal point is just as simple. Just divide by ten and subtract the fraction part of the number instead of multiplying by ten and subtracting the whole part of the number.

If you want to find the *total* number of digits in a number, just count the number of digits in both the fraction and integer parts and add them together (or don't set the counter to zero again).

I hope this helps.

     23 September 2004, 17:43 GMT


Re: Re: Decimal points!
Xeno_Cre8or Account Info

Finding digits to the left is as simple as:

If X=/=0
iPart(log(X))

the If statement is only because log(X) is impossible for 0

     1 September 2009, 01:25 GMT

Re: Math Program Ideas
manuel cortes  Account Info

i need to know where a can find the mode gra of the centesimal degrees, for the voyage, coz i need to topo, this sistem is the more used here, im going to explaind if you dont understandme, the sexagesimal sistem or degrees, have 1 angle stright = 90º, 2 angle stright = 180º, 3 angle stright = 270º, 4 angle stright = 360º, and te radinas are pi/2, pi, 3*pi/2, and 2*pi, well this other sistem is 100, 200, 300, and 400, and i need this last one were a cant find it coz my calculator dosent have it... well thanks

     7 September 2004, 03:32 GMT

General 'cheat sheet' for math from algebra through calculus
AttilaThePun  Account Info

I'm working on a major project that basically is a cheat sheet for algebra through calculus. It would not include solvers (at this stage; it might eventually), but it would display the formulas. This is an attempt to put all the important formulas and some images, such as the unit circle, together in one program for the TI-86 (I can port it to any of the z80 family if I use basic, but I think i will use asm. In this case I can only write for the 86 and 83+.)
If anyone would be willing to give me a list of what you think should be included, I would greatly appreciate it. I have the paper version, but would like to know if I have left anything important out or should drop anything.

     29 September 2004, 14:21 GMT


Re: General 'cheat sheet' for math from algebra through calculus
Max_rulez Account Info

i would like to see it can u email me a copy

     29 May 2006, 10:36 GMT

Re: Math Program Ideas
Alchemist Account Info

Hello, I just bought a brand new TI-89T calculator, and it is PERFECT except for one thing.... I miss my Scitools app from my 83+. This is such a big problem for me that i'm actually considering carrying both of them around just so I can do sigfigs and unit conversions. There's not a whole lot of software like that (and of that quality) for the 89 yet. If I had SciTools on my 89T it would be PERFECT. So....

How hard would it be to port SciTools to the 89T?

Is there anyone out there who would do it, or teach me how to do it (if it can be done w/ little experience)?

     12 October 2004, 19:15 GMT

synthetic division in C
Josh Steinberg  Account Info

I was wondering if anyone has written a program for synthetic divsion of two polynoms (remainder theorem) in C.
Thanks

     1 November 2004, 11:53 GMT

Re: Math Program Ideas
Safunte Account Info

I would like to find help in making a program for factoring trinomials (TI 83+). Preferably using the method found on http://mcraefamily.com/ mathhelp/ factoring3a.htm

plz and ty, i've been working at it for a long time and cant get any positive results

     11 November 2004, 20:19 GMT

Symbolic convolution
Bloker Q Account Info

hi all! is there any Symbolic convolution program for TI 89? iam an EE student and that would be a real help for me! i looked and the only thing i found was convolution inside siganls89... not what i want..
any ideas?

     30 November 2004, 13:28 GMT

1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer