Post Reply 
(49G & 38G & Prime) OEIS A111138: No Short Description
11-18-2017, 02:04 PM (This post was last modified: 11-18-2017 05:43 PM by Arno K.)
Post: #2
RE: (49G) OEIS A111138: No Short Description
I made an algorithm by myself, my apologies if it is similar to yours (I hope not as you don't seem to use a root), my capabilities in reading sysrpl are limited, the program is for the prime and a MAKELIST(A111138(x),x,1,64) provides exactly the same list as in OEIS, it is quite fast and the algorithm is visible (one of the reasons for which I put my 50g into a drawer).
Code:
#cas
A111138(n):=
BEGIN
local m,s;
IF n<3 THEN RETURN 0;END;
IF n≤4 THEN RETURN 1;END;
m:=FLOOR(0.5+0.5*√(8*n+1));
WHILE m*(m-1)≥2*n DO
m:=m-1;
END;
s:=n-m*(m-1)/2;
  return COMB(m,3)+COMB(s,2);
END;
#end
Arno
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (49G) OEIS A111138: No Short Description - Arno K - 11-18-2017 02:04 PM



User(s) browsing this thread: 1 Guest(s)