La recherche a retourné 291 résultats
Aller sur la recherche avancée
- 16 nov. 2017 22:03
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°53 : la suite de Syracuse
- Réponses : 160
- Vues : 74799
Re: Misez p'tit Optimisez n°53 : la suite de Syracuse
I propose this version, more powerful in time of realization (with bigger code, i know). A nice comparison of size vs speed optimizing. Apropos speed, I was able to to make the PB-1000/2000C assembly version slightly faster: @00: ADW $24,#1 LDL $8,$0,L8 ADBL $0,$8,L8 ANC $8,#1 JR NZ,@01 ADBL $8,$0,...
- 09 sept. 2017 14:06
- Forum : Tous les Pockets
- Sujet : Différences Sharp PC-G850 V/VS
- Réponses : 3
- Vues : 3569
Re: Différences Sharp PC-G850 V/VS
Salut,
the only difference is the ROM type. The 850VS contains a flash ROM instead of the mask ROM in the 850V.
the only difference is the ROM type. The 850VS contains a flash ROM instead of the mask ROM in the 850V.
- 29 mai 2017 12:46
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
- 25 mai 2017 22:41
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
A closer look at the sequence of the distances between the numbers of the f^k(n) sequence shows, that it's in general the summation sequence of round(k/2) with an offset. So we need the difference of the total sum minus the sum below the offset, to get the distance to the offset. f^20(1) = 111 1 + 1...
- 25 mai 2017 20:07
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
So, i correct my code to this One-Liner version : 1:"F" INPUT N,K : R=INT (.5+√N , E=INT .5K , F=E-(RR>=N)+(K>2E : PRINT N+KR+EF;"^=";K;N:END Dear C.Ret, I'm really sorry, but apparently there is still a bug in your formula, if I made no mistake while porting it. Please check f^-123(12345)=2536, wh...
- 25 mai 2017 15:00
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
So, I restart computations on my SHARP PC-1211 with this code: 1:" " AREAD N:K=1:INPUT "^";K // Saisie de n et facultativement de k 2:R=INT √N,R=R+(√N>.5+R),E=INT .5K,F=E-R+INT √N+(K>2E),F=N+NK+EF // Calculs de R,E puis F 3:"=" PRINT F;" =^";K;N:END // Affichage peut être affiné I've transferred yo...
- 24 mai 2017 23:04
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
Sorry, but there seems to be a misunderstanding. I've noticed some wrong results in your examples, that made me curious to find out, if it's possible to have a formula with correct results for any argument. My first attempt was very similar to yours, but I noticed that the results are not correct in...
- 24 mai 2017 19:43
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
Calculating f^k(n) for k>0:
d=floor(sqrt(n)*2)-1
if frac(sqrt(n))=0 then d=d-1
n=n+round((k^2+2dk+2k)/4)
Calculating f^k(n) for k<0:
d=floor(sqrt(n)*2)-1
n=n-round((-k^2+2dk+2k)/4)
d=floor(sqrt(n)*2)-1
if frac(sqrt(n))=0 then d=d-1
n=n+round((k^2+2dk+2k)/4)
Calculating f^k(n) for k<0:
d=floor(sqrt(n)*2)-1
n=n-round((-k^2+2dk+2k)/4)
- 22 mai 2017 14:01
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
I have to modify my codes in order to track for perfect square in interim results when using k<0 in sequence. If it's possible to calculate f^k(n) without iterations, it would be more practical to check the result for k<0 with f^-k(result) for plausibility. I wrote "if possible", because I noticed ...
- 21 mai 2017 20:01
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
Faire attention cependant, ce code peu donner avec les composées inverses (k négatifs) des résultats aberrants. En particulier dans le cas de détermination du rang d'un entier carré parfait: 25[shft]-1[ENTER] affiche 20.=^-1.25. Ce qui ne signifie pas que 25 est le 20-ième entier non carré parfait....
- 19 mai 2017 22:33
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
Shorter version for the FX-180P using the square function:
Code : Tout sélectionner
01 1
02 M+
03 Kin+1
04 Kout1
05 x^2
06 x<=M
07 MR
Usage example:
2017 Min 1 Kin1 P1
- 19 mai 2017 16:59
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
The algorithm on the FX-180P for f(n): 01 1 02 M+ 03 2 04 Kin+1 05 Kout1 06 Kin+2 07 Kout2 08 x<=M 09 MR Usage example: 2017 Min 1 Kin1 Kin2 P1 And the inverse of f(n): 01 1 02 Kin-1 03 Kout3 04 Kin-2 05 2 06 Kin+3 07 Kout2 08 x>0 09 Kout1 Usage example: 2062 Kin1 Kin2 1 Kin-2 3 Kin3 P1
- 19 mai 2017 16:12
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
Ok, I've also tried an assembly language friendly way, using increment and decrement only. Maybe there is a shorter way, but here the algorithm in PASCAL for f(n): readln(n); s:=1; i:=1; repeat inc(n); inc(i,2); inc(s,i); until s>n; writeln(n); And the inverse of f(n): readln(n); s:=pred(n); i:=3; r...
- 15 mai 2017 00:12
- Forum : Tous les Pockets
- Sujet : Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
- Réponses : 22
- Vues : 11341
Re: Misez p'tit Optimisez n°79 : Carré Parfait Interdit !
Salut,
If I've understand the problem correcly, n+rnd(sqrt(n)) gives the n-th element of the sequence and n-int(sqrt(n)) gives the position of a non square number in the sequence.
If I've understand the problem correcly, n+rnd(sqrt(n)) gives the n-th element of the sequence and n-int(sqrt(n)) gives the position of a non square number in the sequence.
- 18 avr. 2017 13:25
- Forum : Tous les Pockets
- Sujet : FX-850P vs FX-880P
- Réponses : 8
- Vues : 4760
Re: FX-850P vs FX-880P
All the pockets or calculators using a LC or RC circuit as oscillator can have a tolerance of some percent. But many
of them using ceramic resonators as oscillator, what is usually precise enough to have no significant speed differences.
The FX-850P and FX-880P using a 1.228 MHz ceramic resonator.
of them using ceramic resonators as oscillator, what is usually precise enough to have no significant speed differences.
The FX-850P and FX-880P using a 1.228 MHz ceramic resonator.