Cullen and Woodall numbers: Difference between revisions

added AWK
(Added Go)
(added AWK)
Line 101:
Index of the 1st 12 Woodall primes: 2 3 6 30 75 81 115 123 249 362 384 462
</pre>
=={{header|AWK}}==
 
<lang AWK>
# syntax: GAWK -f CULLEN_AND_WOODALL_NUMBERS.AWK
BEGIN {
start = 1
stop = 20
printf("Cullen %d-%d:",start,stop)
for (n=start; n<=stop; n++) {
printf(" %d",n*(2^n)+1)
}
printf("\n")
printf("Woodall %d-%d:",start,stop)
for (n=start; n<=stop; n++) {
printf(" %d",n*(2^n)-1)
}
printf("\n")
exit(0)
}
</lang>
{{out}}
<pre>
Cullen 1-20: 3 9 25 65 161 385 897 2049 4609 10241 22529 49153 106497 229377 491521 1048577 2228225 4718593 9961473 20971521
Woodall 1-20: 1 7 23 63 159 383 895 2047 4607 10239 22527 49151 106495 229375 491519 1048575 2228223 4718591 9961471 20971519
</pre>
 
=={{header|BASIC}}==
477

edits