HP Forums
(40G) OEIS A027423: Number of Divisors of N! - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (40G) OEIS A027423: Number of Divisors of N! (/thread-9204.html)



(40G) OEIS A027423: Number of Divisors of N! - Gerald H - 10-01-2017 05:46 AM

For last natural number input N to the Home screen the programme returns the Nth element of the series

https://oeis.org/A027423

Code:
IF Ans<2
THEN
1:
ELSE
Ans►N:
1►M:
2►P:
DO
0►S:
P►Q:
DO 
IQUOT(N,Q)►T:
T+S►S:
P*Q►Q:
UNTIL
NOT T
END:
NEXTPRIME(P)►P:
(S+1)*M►M:
UNTIL
N<P
END:
END:



RE: (40G) OEIS A027423: Number of Divisors of N! - Gerald H - 10-04-2017 05:46 PM

Improved programme:

Code:
IF Ans<2
 THEN
 1:
 ELSE
 Ans►N:
 1►M:
 2►P:
 DO
 0►S:
 N►T:
 DO 
 IQUOT(T,P)►T:
 T+S►S:
 UNTIL
 NOT T
 END:
 NEXTPRIME(P)►P:
 (S+1)*M►M:
 UNTIL
 N<P
 END:
 END: