À l'utilisateur de mettre 1 STO 6 avant de lancer le programme pour le premier test.
Misez p'tit Optimisez n°57 : palindromes
Modérateur : Politburo
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
En mettant 0 STO 6 au début du programme déjà... Je crois voire la suite...

À l'utilisateur de mettre 1 STO 6 avant de lancer le programme pour le premier test.
À l'utilisateur de mettre 1 STO 6 avant de lancer le programme pour le premier test.
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
TI-57 v2
Bon, j'ai déjà réduit le code. À chaque fois que je décalais en divisant par 10 le nombre à inverser, je mémorisais la partie entière. Plutôt que de faire ça (4 pas), je ne garde que la partie entière de l'unité récupéré (2 pas) ; stocker 10 dans la mémoire 5 (permet de gagner 3 pas dans le programme).
S'affiche alors — ou pas — le nombre palindromique.
Limite
ce nombre ne doit pas être un palindrome ; si besoin, saisir son double
Limite
TI-57 v3
337722
1320231 en 3 fois... Il trouve 9339 depuis 591 en 39 secondes (4 traitements).
Code : Tout sélectionner
00 32 1 STO 1
01 32 3 STO 2
02 00 0
03 32 7 STO 7
04 33 1 RCL 1
05 18 LOG
06 49 INT
07 75 +
08 01 1
09 85 =
10 32 0 STO 0
11 86 0 LBL 0
12 33 7 RCL 7
13 55 *
14 33 5 RCL 5
15 85 =
16 32 7 STO 7
17 33 1 RCL 1
18 45 ÷
19 33 5 RCL 5
20 85 =
21 32 1 STO 1
22 49- FRAC
23 55 *
24 33 5 RCL 5
25 85 =
26 49 INT
27 85 =
28 34 7 SUM 7
29 56 DSZ
30 51 0 GTO 0
31 33 3 RCL 2
32 75 +
33 33 7 RCL 7
34 85 =
35 81 R/SCode : Tout sélectionner
10 STO 5
_________
0 STO 6
nombre [RST] [R/S]Code : Tout sélectionner
RCL 6 ' le nombre de traitement effectué.
RCL 3 ' le nombre au lancement du traitement
RCL 2 ' le nombre palindromique
TI-57 v3
Code : Tout sélectionner
00 32 1 STO 1
01 32 2 STO 2
02 32 3 STO 3
03 86 0 LBL 0
04 00 0
05 32 7 STO 7
06 33 1 RCL 1
07 18 LOG
08 49 INT
09 75 +
10 01 1
11 85 =
12 32 0 STO 0
13 86 0 LBL 1
14 33 7 RCL 7
15 55 *
16 33 5 RCL 5
17 85 =
18 32 7 STO 7
19 33 1 RCL 1
20 45 ÷
21 33 5 RCL 5
22 85 =
23 32 1 STO 1
24 49- FRAC
25 55 *
26 33 5 RCL 5
27 85 =
28 49 INT
29 34 7 SUM 7
30 56 DSZ
31 51 0 GTO 1
32 33 3 RCL 2
33 75 +
34 33 7 RCL 7
35 85 =
36 32 1 STO 1
37 33 2 RCL 2
38 66- x≠t?
39 51 2 GTO 2
40 81 R/S
41 86 2 LBL 2
42 33 1 RCL 1
43 32 2 STO 2
44 01 1
45 34 6 SUM 6
46 51 0 GTO 0
Dernière édition par Thierry Loiseau le 21 mars 2017 18:47, édité 1 fois.
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
TI-57 version Deluxe
Après la réduction du code v3, j'ai pu placer 0 STO 6...
Bientôt la version PRO...
Thierry
Code : Tout sélectionner
00 32 1 STO 1
01 32 2 STO 2
02 32 3 STO 3
03 00 0
04 32 6 STO 6
05 86 0 LBL 0
06 00 0
07 32 7 STO 7
08 33 1 RCL 1
09 18 LOG
10 49 INT
11 75 +
12 01 1
13 85 =
14 32 0 STO 0
15 86 1 LBL 1
16 33 7 RCL 7
17 55 *
18 33 5 RCL 5
19 85 =
20 32 7 STO 7
21 33 1 RCL 1
22 45 ÷
23 33 5 RCL 5
24 85 =
25 32 1 STO 1
26 49- FRAC
27 55 *
28 33 5 RCL 5
29 85 =
30 49 INT
31 34 7 SUM 7
32 56 DSZ
33 51 1 GTO 1
34 33 3 RCL 2
35 75 +
36 33 7 RCL 7
37 85 =
38 32 1 STO 1
39 33 2 RCL 2
40 66- x≠t?
41 51 2 GTO 2
42 81 R/S
43 86 2 LBL 2
44 33 1 RCL 1
45 32 2 STO 2
46 01 1
47 34 6 SUM 6
48 51 0 GTO 0
Code : Tout sélectionner
10 STO 5
____________
[NOMBRE] [RST [R/S]
____________
RCL 2 : Nombre palindromique
RCL 3 : Nombre au lancement
RCL 6 : Nombre de traitement
Thierry
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
Réduction du code :

TI-57 version PRO
Plus besoin de stocker 10 dans 5... 10 inclus dans le programme 
Edit : optimisation n°1
Code : Tout sélectionner
RCL 7 * 10 = STO 7
simplifié par
10 Prd 7
RCL 1 ÷ 10 = STO 1
simplifié par
10 INV Prd 1

TI-57 version PRO
Code : Tout sélectionner
00 32 1 STO 1
01 32 2 STO 2
02 32 3 STO 3
03 00 0
04 32 6 STO 6
05 86 0 Lbl 0
06 00 0
07 32 7 STO 7
08 33 1 RCL 1
09 18 log
10 49 Int
11 75 +
12 01 1
13 85 =
14 32 0 STO 0
15 86 1 Lbl 1
16 01 1
17 00 0
18 39 7 Prd 7
19 01 1
20 00 0
21 - 39 1 INV Prd 1
22 33 1 RCL 1
23 - 49 Frac
24 55 *
25 01 1
26 00 0
27 85 =
28 49 Int
29 34 7 SUM 7
30 56 Dsz
31 51 1 GTO 1
32 33 7 RCL 07
33 32 1 STO 01
34 33 2 RCL 02
35 34 1 SUM 01
36 56 x=t?
37 81 R/S
38 33 1 RCL 1
39 32 2 STO 2
40 01 1
41 34 6 SUM 6
42 51 0 GTO 0Edit : optimisation n°1
Dernière édition par Thierry Loiseau le 21 mars 2017 14:03, édité 3 fois.
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
Re: Misez p'tit Optimisez n°57 : palindromes
Bonjour
Tu peut optimiser :
par :
Tu peut optimiser :
Code : Tout sélectionner
32 RCL 02
33 +
34 RCL 07
35 =
36 STO 01
37 RCL 02
38 x=t?
Code : Tout sélectionner
32 RCL 07
33 STO 01
34 RCL 02
35 SUM 01
36 x=t?
Ti(s) 60, 62 Galaxy, 66, 67 Galaxy, 68, 74 Basical 80, 81, 82, 83+, 83 CE, 84+SE, 85, 86, 89, 89 titanium, 92, 95 Procalc, v200, nSpire cx
Hp(s) 41CX, 28S, 48g, 50g, 39gII, Prime G1 et G2,
Casio(s) fx 602P, 702P, 4000P, 4500P, 6000G, 6900G, 7700G, 8500g, PB-700, CG-20, Graph 95 sd
Psion(s)II LZ64, siena, s3a, s3mx, s5mx.
Sharp(s) pc-1350, 1403, 1500A, El 5120, 9200, 9600
Canon X-07
Hp(s) 41CX, 28S, 48g, 50g, 39gII, Prime G1 et G2,
Casio(s) fx 602P, 702P, 4000P, 4500P, 6000G, 6900G, 7700G, 8500g, PB-700, CG-20, Graph 95 sd
Psion(s)II LZ64, siena, s3a, s3mx, s5mx.
Sharp(s) pc-1350, 1403, 1500A, El 5120, 9200, 9600
Canon X-07
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
Bien vu ! Je modifie ! 
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
Une autre version PRO TI-57
La fin modifiée...
Mettre au préalable 100 dans la mémoire 4 :
Retourne donc dans la partie décimale le nombre d'itérations.
Par contre, je n'ai pas encore vu de cas où ce nombre est >4 et <100...

Code : Tout sélectionner
00 32 1 STO 1
01 32 2 STO 2
02 32 3 STO 3
03 00 0
04 32 6 STO 6
05 86 0 LBL 0
06 00 0
07 32 7 STO 7
08 33 1 RCL 1
09 18 log
10 49 Int
11 75 +
12 01 1
13 85 =
14 32 0 STO 0
15 86 1 LBL 1
16 01 1
17 00 0
18 39 7 Prd 7
19 01 1
20 00 0
21 - 39 1 INV Prd 1
22 33 1 RCL 1
23 - 49 Frac
24 55 ×
25 01 1
26 00 0
27 85 =
28 49 Int
29 34 7 SUM 7
30 56 Dsz
31 51 1 GTO 1
32 33 7 RCL 7
33 32 1 STO 1
34 33 2 RCL 2
35 34 1 SUM 1
Code : Tout sélectionner
36 - 66 x≠t?
37 51 2 GTO 2
38 33 4 RCL 4
39 - 39 6 INV Prd 6
40 33 6 RCL 6
41 34 2 SUM 2
42 33 2 RCL 2
43 81 R/S
44 86 2 LBL 2
45 33 1 RCL 1
46 32 2 STO 2
47 01 1
48 34 6 SUM 6
49 51 0 GTO 0
Code : Tout sélectionner
100 STO 4
______
195 [RST] [R/S]
9339.04Par contre, je n'ai pas encore vu de cas où ce nombre est >4 et <100...
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
En modifiant mon ancien code...
J'ai dû insérer ça, sinon, ça dépasse les bornes...
167 donne 88555588 en 2mn26s et 11 itérations.
Code : Tout sélectionner
00 32 1 STO 1
01 32 2 STO 2
02 32 3 STO 3
03 00 0
04 32 6 STO 6
05 86 0 LBL 0
06 00 0
07 32 7 STO 7
08 33 1 RCL 1
09 18 log
10 49 Int
11 75 +
12 01 1
13 85 =
14 32 0 STO 0
15 86 1 LBL 1
16 01 1
17 00 0
18 39 7 Prd 7
19 01 1
20 00 0
21 - 39 1 INV Prd 1
22 33 1 RCL 1
23 - 49 Frac
24 55 *
25 01 1
26 00 0
27 85 =
28 49 Int
29 34 7 SUM 7
Code : Tout sélectionner
30 33 1 RCL 1
31 49 Int
32 32 1 STO 1
Code : Tout sélectionner
33 56 Dsz
34 51 0 GTO 1
35 33 7 RCL 7
36 32 1 STO 1
37 33 2 RCL 2
38 34 1 SUM 1
39 66 x=t?
40 81 R/S
41 33 1 RCL 1
42 32 2 STO 2
43 01 1
44 34 6 SUM 6
45 51 0 GTO 0
Code : Tout sélectionner
167+761=928
928+829=1757
1757+7571=9328
9328+8239=17567
17567+76571=94138
94138+83149=177287
177287+782771=960058
960058+850069=1810127
1810127+7210181=9020308
9020308+8030209=17050517
17050517+71505071=88555588
HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
- Thierry Loiseau
- Fonctionne à 1200 bauds

- Messages : 822
- Inscription : 10 avr. 2004 22:23
- Localisation : Terrasson (Périgord)
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
J'ai fait un petit programme en Javascript... voici les palindromes de 168 à 195 :
Code : Tout sélectionner
168+861=1029
1029+9201=10230
10230+3201=13431
[168] <-> 3 [13431]
169+961=1130
1130+311=1441
[169] <-> 2 [1441]
170+71=241
241+142=383
[170] <-> 2 [383]
[171] <-> 0 [171]
172+271=443
443+344=787
[172] <-> 2 [787]
173+371=544
544+445=989
[173] <-> 2 [989]
174+471=645
645+546=1191
1191+1911=3102
3102+2013=5115
[174] <-> 4 [5115]
175+571=746
746+647=1393
1393+3931=5324
5324+4235=9559
[175] <-> 4 [9559]
176+671=847
847+748=1595
1595+5951=7546
7546+6457=14003
14003+30041=44044
[176] <-> 5 [44044]
177+771=948
948+849=1797
1797+7971=9768
9768+8679=18447
18447+74481=92928
92928+82929=175857
175857+758571=934428
934428+824439=1758867
1758867+7688571=9447438
9447438+8347449=17794887
17794887+78849771=96644658
96644658+85644669=182289327
182289327+723982281=906271608
906271608+806172609=1712444217
1712444217+7124442171=8836886388
[177] <-> 15 [8836886388]
178+871=1049
1049+9401=10450
10450+5401=15851
[178] <-> 3 [15851]
179+971=1150
1150+511=1661
[179] <-> 2 [1661]
180+81=261
261+162=423
423+324=747
[180] <-> 3 [747]
[181] <-> 0 [181]
182+281=463
463+364=827
827+728=1555
1555+5551=7106
7106+6017=13123
13123+32131=45254
[182] <-> 6 [45254]
183+381=564
564+465=1029
1029+9201=10230
10230+3201=13431
[183] <-> 4 [13431]
184+481=665
665+566=1231
1231+1321=2552
[184] <-> 3 [2552]
185+581=766
766+667=1433
1433+3341=4774
[185] <-> 3 [4774]
186+681=867
867+768=1635
1635+5361=6996
[186] <-> 3 [6996]
187+781=968
968+869=1837
1837+7381=9218
9218+8129=17347
17347+74371=91718
91718+81719=173437
173437+734371=907808
907808+808709=1716517
1716517+7156171=8872688
8872688+8862788=17735476
17735476+67453771=85189247
85189247+74298158=159487405
159487405+504784951=664272356
664272356+653272466=1317544822
1317544822+2284457131=3602001953
3602001953+3591002063=7193004016
7193004016+6104003917=13297007933
13297007933+33970079231=47267087164
47267087164+46178076274=93445163438
93445163438+83436154439=176881317877
176881317877+778713188671=955594506548
955594506548+845605495559=1801200002107
1801200002107+7012000021081=8813200023188
[187] <-> 23 [8813200023188]
188+881=1069
1069+9601=10670
10670+7601=18271
18271+17281=35552
35552+25553=61105
61105+50116=111221
111221+122111=233332
[188] <-> 7 [233332]
189+981=1170
1170+711=1881
[189] <-> 2 [1881]
190+91=281
281+182=463
463+364=827
827+728=1555
1555+5551=7106
7106+6017=13123
13123+32131=45254
[190] <-> 7 [45254]
[191] <-> 0 [191]
192+291=483
483+384=867
867+768=1635
1635+5361=6996
[192] <-> 4 [6996]
193+391=584
584+485=1069
1069+9601=10670
10670+7601=18271
18271+17281=35552
35552+25553=61105
61105+50116=111221
111221+122111=233332
[193] <-> 8 [233332]
194+491=685
685+586=1271
1271+1721=2992
[194] <-> 3 [2992]
195+591=786
786+687=1473
1473+3741=5214
5214+4125=9339
[195] <-> 4 [9339]HP-41C, HP-12C ; Casio FX-702P, FX-850P, FX-602P, FX-3900P, FX-4000P, FX-180Pv ;
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
TI 57 avec adaptation d'une pile LR9 et une originale, accus HS; Newton MP 120FR, MP 2100US, MP 130US...
Apple //e, 7100, 8100, 8500, PB-540c, PISMO, CPC-6128, MO5... et bien d'autres trucs
http://astrophoto.free.fr/
Re: Misez p'tit Optimisez n°57 : palindromes
Bravo !!
Casio FX-502P /602P / 603P / FX180P+ / FX4000P / TI57 / TI66 / TI74 Basicalc / TI95 Procalc / HP12C / HP15C LE / DM41L / HP 30B / HP39GII / HP 48SX USA / 49G / 49G+ / 50G / 50G NewRPL / HP Prime / Oric 1 / Amstrad CPC 6128+
- gege
- Fonctionne à 14400 bauds

- Messages : 7180
- Inscription : 31 janv. 2008 15:24
- Localisation : Banlieue Paârisienne
- Contact :
Re: Misez p'tit Optimisez n°57 : palindromes
Bonjour,
C'est beau !!
Bravo
G.E.
C'est beau !!
Bravo
G.E.

