Jump to content

Cullen and Woodall numbers: Difference between revisions

no edit summary
m (→‎{{header|RPL}}: Formatting)
imported>Maxima enthusiast
No edit summary
Line 1,075:
{1, 141, 4713, 5795, 6611}
{2, 3, 6, 30, 75, 81, 115, 123, 249, 362, 384, 462}</pre>
 
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
/* Functions */
cullen(n):=(n*2^n)+1$
woodall(n):=(n*2^n)-1$
 
/* Test cases */
makelist(cullen(i),i,20);
makelist(woodall(i),i,20);
</syntaxhighlight>
{{out}}
<pre>
[3,9,25,65,161,385,897,2049,4609,10241,22529,49153,106497,229377,491521,1048577,2228225,4718593,9961473,20971521]
 
[1,7,23,63,159,383,895,2047,4607,10239,22527,49151,106495,229375,491519,1048575,2228223,4718591,9961471,20971519]
</pre>
 
=={{header|Nim}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.