Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Sylvesters-sequence/AWK/sylvesters-sequence.awk
Normal file
12
Task/Sylvesters-sequence/AWK/sylvesters-sequence.awk
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# syntax: GAWK --bignum -f SYLVESTERS_SEQUENCE.AWK
|
||||
BEGIN {
|
||||
start = 1
|
||||
stop = 10
|
||||
for (i=start; i<=stop; i++) {
|
||||
sylvester = (i == 1) ? 2 : sylvester*sylvester-sylvester+1
|
||||
printf("%2d: %d\n",i,sylvester)
|
||||
sum += 1 / sylvester
|
||||
}
|
||||
printf("\nSylvester sequence %d-%d: sum of reciprocals %30.28f\n",start,stop,sum)
|
||||
exit(0)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue