Discussion
Tue Dec 29
00:37
Michel Marcus: seems ok, but I don't understand pari syntax: an if with 4 commas
02:46
Joerg Arndt: if(cond1, cmd1, cond2, cmd2); this is an (syntactically ugly) equivalent of if(cond1) cmd1; else_if (cond2) cmd2;
PROG
(PARI) a(n) = n*=3; if(n%2, sqrtnint(1<<n, 4)+1, n%4, sqrtint(1<<(n/2))+1, 1<<(n/4)); \\ Kevin Ryde, Dec 29 2020
Discussion
Tue Dec 29
00:15
Kevin Ryde: Pari sqrtnint I was thinking. n mod 4 cases separated since they run much faster than giving all to sqrtnint.
Discussion
Mon Dec 28
04:27
Michel Marcus: maybe next time
Discussion
Mon Dec 28
02:43
Kevin Ryde: Michel: some Pari sqrtnint(8^n,4) + (n%4 something something) could stay away from floats. Only an exact int when n multiple of 4 ...
04:26
Michel Marcus: yes probably perhaps but I don't see the "something something" right now