<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Divisible Number Program Help</title>
		<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help</link>
		<description>Posts in the discussion thread &quot;Divisible Number Program Help&quot; - I has a problem and I need your ideas and help to fix.</description>
				<copyright></copyright>
		<lastBuildDate>Tue, 21 Jul 2026 20:18:32 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1525400</guid>
				<title>(no title)</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1525400</link>
				<description></description>
				<pubDate>Wed, 01 Aug 2012 22:23:44 +0000</pubDate>
				<wikidot:authorName>George Litauszky</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Because I'm only a guest here, I can't edit my posts. Here is a typo in prg list above:</p> <div class="code"> <pre><code> If c/d ≠ d Then © If block: for the sake of number c/d-&gt;q[g] © duplicating in the q list. g+1-&gt;g © &lt;&lt;&lt;- This is the missing line. EndIf</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1525276</guid>
				<title>(no title)</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1525276</link>
				<description></description>
				<pubDate>Wed, 01 Aug 2012 20:26:30 +0000</pubDate>
				<wikidot:authorName>George Litauszky</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>And 5 of course.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1525253</guid>
				<title>(no title)</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1525253</link>
				<description></description>
				<pubDate>Wed, 01 Aug 2012 20:07:01 +0000</pubDate>
				<wikidot:authorName>George Litauszky</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p><strong>BTW1:</strong><br /> I converted Xeda's code to 68k Basic format. Despite any syntax and a program structure error the program's logic is correct and demontstrate the short, fast and deliberate programming opposite the brute force method, congratulations. :)</p> <div class="code"> <pre><code>xeda(a,b) © a, b numbers= parameters Prgm Local c,d,g gcd(a,b)-&gt;c newList(c)-&gt;q 1-&gt;g iPart(sqr(c))-&gt;d While d&gt;0 © While d&gt;1={}(empty list output) if a=2 and b=4 for ex. While mod(c/d,1)&gt;0 © We need add a condition in 68k basic. d-1-&gt;d EndWhile d-&gt;q[g] g+1-&gt;g If c/d ≠ d Then © If block: for the sake of number c/d-&gt;q[g] © duplicating in the q list. EndIf d-1-&gt;d © Without this, infinite loop. EndWhile left(q,g-1)-&gt;q © q list without zeros. SortA q disp q EndPrgm</code></pre></div> <p><strong>BTW2:</strong><br /> &quot;I am not sure if factor() can be used on integers, but if it can, use it.&quot;<br /> Yes. If the 2 numbers are <strong>a=20</strong> and <strong>b=40</strong> for example, the shortest way to calculate all the common divisors without programming is this:</p> <p><span style="font-size:1.5em;"><strong>factor(gcd(20,40)) = 2^2*5</strong></span></p> <p>So the divisors are: 2, 2^2, 2*5, 2^2*5.<br /> I like this text formatting. ;)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1522415</guid>
				<title>(no title)</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1522415</link>
				<description></description>
				<pubDate>Mon, 30 Jul 2012 06:11:03 +0000</pubDate>
				<wikidot:authorName>George Litauszky</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>:List P {5,6,7}<br /> :List Q {6,8,9}</p> <p>If you convert List P to string, you can search in it with the inString command. If the result is not 0, it's a new common divisor.</p> <p>common()<br /> Prgm<br /> Local pstr,qsi,n,nr<br /> string(p)-&gt;pstr<br /> dim(q)-&gt;qsi<br /> 0-&gt;nr<br /> newList(qsi)-&gt;res<br /> For n,1,qsi<br /> If inString(pstr,string(q[n]))&lt;&gt;0 Then<br /> nr+1-&gt;nr<br /> q[n]-&gt;res[nr]<br /> EndIf<br /> EndFor<br /> left(res,nr)-&gt;res<br /> Disp res<br /> EndPrgm</p> <p>How can I insert here a formatted text?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1476633</guid>
				<title>Re: Divisible Number Program Help</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1476633</link>
				<description></description>
				<pubDate>Mon, 11 Jun 2012 01:24:19 +0000</pubDate>
				<wikidot:authorName>blue_bear_94</wikidot:authorName>				<wikidot:authorUserId>1272660</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>SortA does not use parentheses. Also, note that variable names would be converted into lowercase on execution.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1476158</guid>
				<title>Re: Divisible Number Program Help</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1476158</link>
				<description></description>
				<pubDate>Sun, 10 Jun 2012 11:16:07 +0000</pubDate>
				<wikidot:authorName>Xeda Elnara</wikidot:authorName>				<wikidot:authorUserId>595803</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Okay, I have a crazy idea, I don't have my TI-89 right here and I won't have internet after today for a while, buut here goes&#8230;</p> <div class="code"> <pre><code>Input A Input B gcd(A,B)→C ;All you have to do is find all the factors to this {C}→q 1→G iPart(sqrt(C))→D While D&gt;1 While fPArt(C/D) ;I would have just used mod(), but I am not sure how the TI-89 handles mod 1. D-1→D EndWhile D→q[G] G+1→G C/D→q[G] G+1→G EndWhile SortA(q)</code></pre></div> <p>I've never had much practice with 89 BASIC, so some of the syntax might be wrong and I haven't tested the code yet, but hopefully it works. I am not sure if factor() can be used on integers, but if it can, use it.</p> <p>In case you don't get why all you need to do is factor the GCD of the two numbers, think about it&#8212; the Greatest Common Divisor has all the mutual factors. If you do A/GCD(A,B) and B/GCD(A,B), they are by definition relatively prime (so they have no common factors). As a side note for the curious, the code I provided is not even close to polynomial time speed, but GCD itself is a polynomial time algorithm (and quite simple, too).</p> <p>I like math &gt;.&gt;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1475995</guid>
				<title>Re: Divisible Number Program Help</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1475995</link>
				<description></description>
				<pubDate>Sun, 10 Jun 2012 03:46:37 +0000</pubDate>
				<wikidot:authorName>7HQR</wikidot:authorName>				<wikidot:authorUserId>1260783</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I do not know the TI-89 language but I can give you the general outline of how I would write it with the 83</p> <p>For(A,1,*first#*<br /> If *first#* is divisible by A<br /> store A to list1<br /> End<br /> For(A,1,*second#*<br /> If *second#* is divisible by A<br /> store A to list2<br /> End<br /> For(A,1,*length of list1*<br /> If list1(A) is in List 2<br /> store # to list3<br /> End<br /> Clear lists1and2<br /> list3 has your common divisibles</p> <p>Sorry if that doesn't help really because I don't know the language</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-484589#post-1475265</guid>
				<title>Divisible Number Program Help</title>
				<link>http://tibasicdev.wikidot.com/forum/t-484589/divisible-number-program-help#post-1475265</link>
				<description></description>
				<pubDate>Sat, 09 Jun 2012 02:43:30 +0000</pubDate>
				<wikidot:authorName>Keynah</wikidot:authorName>				<wikidot:authorUserId>1378963</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I am currently making a program that takes two numbers, A and B, and find the divisible numbers between them both.<br /> Ex. 40 and 20, 1,2,4,10,etc.</p> <p>To accomplish this task I need some help,</p> <p>One element of this program is taking the two numbers dividing them by a common integer then storing each number after division to a list</p> <div class="code"> <pre><code>:1→N :1→G {0,0,0}→q This stores (0,0,0) to a the variable q, but also makes it a list {0,0,0}→r :Input A Input two numbers :Input B : :A/n→q[g] Division by common number, Q and R are lists with g being the position the divided number is being stored. :B/n→r[g] :</code></pre></div> <p>Now the really tricky part is here.</p> <p>How do i cross check each of the lists to find a common number besides using SortA and SortD since they have limited use?</p> <div class="code"> <pre><code>Ex. :List Q {5,6,7} :List R {6,8,9} : : : Using SortA or SortD would not work to cross check the lists even though there is a common number.</code></pre></div> <p>*SideNote I typed this all by hand so if the coding looks funky thats my bad*</p> <p>Please comment to help me in TI-89 Format with somewhat of an explaintion of your coding.<br /> -Thanks Keynah</p> <p>(I will check this in 2-3 days , 6/8/2012)</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>