Sunday, November 24, 2019

TI 84 Plus CE, HP 42S/DM42: Pairs of Multiples

TI 84 Plus CE, HP 42S/DM42:  Pairs of Multiples

Introduction

The program MULPAIRS displays all the multiplication pairs of a positive integer.  For example, for n = 15:

15 = 1 * 15
15 = 3 * 5

The TI-84 Plus CE version gives a list of pairs ( first element * second element,  third element * fourth element, etc).   ( {1, 15, 3, 5})

The HP 42S version will display pairs on the display, one pair at a time. 

TI-84 Plus CE Program: MULPAIRS

"2019-10-26 EWS"
Input "INTEGER N? ",N
iPart (√(N))→S
{1,N}→L_1
For(K,2,S)
N/K→T
If fPart(T)=0
augment(L_1,{K,T})→L_1
End
Pause L_1

L_1 is the list variable L1, accessed by pressing [ 2nd ] [ 1 ].

HP 42S/DM42 Program:  MULPAIRS

00 {51-Byte Prgm}
01 LBL "MPAIRS"
02 STO 00
03 SQRT
04 IP
05 STO 01
06 1
07 RCL 00
08 STOP
09 2
10 RCL 01
11 1E-3
12 *
13 +
14 STO 02
15 LBL 01
16 RCL 00
17 RCL 02
18 IP
19 ÷
20 FP
21 X≠0
22 GTO 02
23 LAST X
24 ENTER
25 ENTER
26 RCL 00
27 X<>Y
28 ÷
29 STOP
30 LBL 02
31 ISG 02
32 GTO 01
33 RTN

Example

N = 64
TI-84 Plus CE:  {1, 64, 2, 32, 4, 16, 8, 8}
HP 42S/DM42:  1, 64, R/S;  2, 32, R/S;  4, 16, R/S;  8, 8

64 = 1 * 64 = 2 * 32 = 4 * 16 = 8^2

Eddie


All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

  Casio fx-7000G vs Casio fx-CG 50: A Comparison of Generating Statistical Graphs Today’s blog entry is a comparison of how a hist...