Skip to content

Commit

Permalink
updated programs
Browse files Browse the repository at this point in the history
  • Loading branch information
loda-bot committed Oct 19, 2024
1 parent e0b3128 commit 0435d83
Show file tree
Hide file tree
Showing 275 changed files with 2,070 additions and 1,755 deletions.
2 changes: 1 addition & 1 deletion oeis/000/A000190.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lpb $0
mov $3,$0
pow $3,4
mod $3,$2
cmp $3,0
equ $3,0
sub $0,1
add $1,$3
lpe
Expand Down
35 changes: 11 additions & 24 deletions oeis/000/A000364.asm
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
; A000364: Euler (or secant or "Zig") numbers: e.g.f. (even powers only) sec(x) = 1/cos(x).
; Submitted by Sir Stooper
; Submitted by Science United
; 1,1,5,61,1385,50521,2702765,199360981,19391512145,2404879675441,370371188237525,69348874393137901,15514534163557086905,4087072509293123892361,1252259641403629865468285,441543893249023104553682821,177519391579539289436664789665,80723299235887898062168247453281,41222060339517702122347079671259045,23489580527043108252017828576198947741,14851150718114980017877156781405826684425,10364622733519612119397957304745185976310201,7947579422597592703608040510088070619519273805

mov $1,4
pow $1,$0
mul $0,2
mov $5,$0
add $0,1
mov $2,$0
lpb $0
sub $0,1
div $7,2
add $7,$3
mul $7,2
add $8,1
mov $3,$2
add $3,$8
pow $3,$5
sub $3,$7
mov $4,$5
bin $4,$2
mul $4,$3
add $2,1
mul $6,-1
add $6,$4
mov $0,102
mov $1,51
mov $2,51
lpe
gcd $6,$0
mov $0,$6
div $0,$1
add $2,$1
mov $1,4
pow $1,$2
seq $2,2436 ; E.g.f.: Sum_{n >= 0} a(n)*x^(2*n)/(2*n)! = sec(2*x).
div $2,$1
mov $0,$2
14 changes: 6 additions & 8 deletions oeis/001/A001950.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
; 2,5,7,10,13,15,18,20,23,26,28,31,34,36,39,41,44,47,49,52,54,57,60,62,65,68,70,73,75,78,81,83,86,89,91,94,96,99,102,104,107,109,112,115,117,120,123,125,128,130,133,136,138,141,143,146,149,151,154,157,159,162,164,167,170,172,175,178,180,183,185,188,191,193,196,198,201,204,206,209

add $0,1
mov $2,$0
add $2,$0
mul $2,2
add $2,$0
mul $2,$0
nrt $2,2
add $2,$0
mov $1,$2
mov $1,$0
mul $1,4
add $1,$0
mul $1,$0
nrt $1,2
add $1,$0
div $1,2
add $0,$1
37 changes: 16 additions & 21 deletions oeis/001/A001956.asm
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
; A001956: Beatty sequence of (5+sqrt(13))/2.
; Submitted by p3d-cluster
; Submitted by Ralfy
; 4,8,12,17,21,25,30,34,38,43,47,51,55,60,64,68,73,77,81,86,90,94,98,103,107,111,116,120,124,129,133,137,141,146,150,154,159,163,167,172,176,180,185,189,193,197,202,206,210,215,219,223,228,232,236,240,245,249,253,258,262,266,271,275,279,283,288,292,296,301,305,309,314,318,322,327,331,335,339,344
; Formula: a(n) = d(n+1)+e(n+1), b(n) = truncate((-c(n-1)+b(n-1))/2), b(3) = -18, b(2) = -4, b(1) = 0, b(0) = 1, c(n) = 4*gcd(max(d(n-1)-2,0)+truncate((-c(n-1)+b(n-1))/2)-1,4)*c(n-1), c(3) = 128, c(2) = 32, c(1) = 8, c(0) = 2, d(n) = truncate(gcd(max(d(n-1)-2,0)+truncate((-c(n-1)+b(n-1))/2)-1,4)/2), d(3) = 0, d(2) = 0, d(1) = 0, d(0) = 0, e(n) = d(n-1)+e(n-1)+4, e(3) = 12, e(2) = 8, e(1) = 4, e(0) = 0

mov $1,1
mov $2,2
mov $1,$0
mul $1,2
add $0,1
lpb $0
sub $0,1
sub $1,$2
div $1,2
add $4,$3
add $4,4
trn $3,2
sub $3,1
add $3,$1
gcd $3,4
mul $2,4
mul $2,$3
div $3,2
lpe
add $4,1
add $3,$4
mov $0,$3
mov $2,$0
mul $2,5
add $2,$0
mul $2,2
add $2,$0
mul $2,$0
nrt $2,2
add $2,$0
mov $0,$2
div $0,2
sub $0,1
add $1,$0
mov $0,$1
add $0,3
28 changes: 12 additions & 16 deletions oeis/001/A001965.asm
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
; A001965: u-pile count for the 4-Wythoff game with i=2.
; Submitted by Geoff
; Submitted by Science United
; 0,1,3,4,5,6,8,9,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,29,30,31,32,33,35,36,37,38,40,41,42,43,45,46,47,48,50,51,52,53,55,56,57,58,59,61,62,63,64,66,67,68,69,71,72,73,74,76,77,78,79,80,82,83,84,85,87,88,89,90,92,93,94,95,97,98

mul $0,2
sub $1,$0
mov $2,$0
add $2,1
mov $3,$2
add $3,$2
mul $3,2
add $3,$2
mul $3,$2
nrt $3,2
add $3,$2
mov $2,$3
div $2,2
add $2,2
mov $1,$0
add $1,1
mov $2,$1
add $2,$1
mov $0,$2
sub $0,3
mul $2,2
add $2,$1
mul $2,$1
nrt $2,2
sub $2,$1
mov $1,$2
div $1,2
mov $0,$1
20 changes: 9 additions & 11 deletions oeis/001/A001966.asm
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
; A001966: v-pile counts for the 4-Wythoff game with i=2.
; Submitted by shiva
; Submitted by Vato
; 2,7,13,18,23,28,34,39,44,49,54,60,65,70,75,81,86,91,96,102,107,112,117,123,128,133,138,143,149,154,159,164,170,175,180,185,191,196,201,206,212,217,222,227,233,238,243,248,253,259,264,269,274,280,285,290,295,301,306,311,316,322,327,332,337,342,348,353,358,363,369,374,379,384,390,395,400,405,411,416

mul $0,2
add $0,1
mov $2,$0
add $2,$0
mul $2,2
add $2,$0
mul $2,$0
nrt $2,2
add $2,$0
mov $1,$2
div $1,2
mov $1,$0
add $1,$0
mul $1,2
add $1,$0
mov $0,$1
mul $1,$0
nrt $1,2
add $1,$0
div $1,2
add $0,$1
43 changes: 26 additions & 17 deletions oeis/002/A002251.asm
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
; A002251: Start with the nonnegative integers; then swap L(k) and U(k) for all k >= 1, where L = A000201, U = A001950 (lower and upper Wythoff sequences).
; Submitted by Science United
; Submitted by Josemi
; 0,2,1,5,7,3,10,4,13,15,6,18,20,8,23,9,26,28,11,31,12,34,36,14,39,41,16,44,17,47,49,19,52,54,21,57,22,60,62,24,65,25,68,70,27,73,75,29,78,30,81,83,32,86,33,89,91,35,94,96,37,99,38,102,104,40,107,109,42,112,43,115,117,45,120,46,123,125,48,128

mov $3,$0
mov $5,2
lpb $5
sub $5,1
add $0,$5
sub $0,1
mov $4,$0
max $4,0
seq $4,19445 ; Form a permutation of the positive integers, p_1, p_2, ..., such that the average of each initial segment is an integer, using the greedy algorithm to define p_n; sequence gives p_1 + ... + p_n.
mov $2,$5
mul $2,$4
add $1,$2
add $0,1
mov $4,$0
mov $6,2
lpb $6
sub $6,1
mov $3,$4
add $3,$4
mul $3,2
add $3,$4
mul $3,$4
nrt $3,2
sub $3,$4
mov $2,$3
div $2,2
mov $0,$4
mul $0,2
mul $0,$2
div $0,2
sub $4,1
mov $5,$6
mul $5,$0
add $1,$5
lpe
min $3,1
mul $3,$4
sub $1,$3
min $4,1
mul $4,$0
mov $0,$1
sub $0,1
sub $0,$4
2 changes: 1 addition & 1 deletion oeis/002/A002503.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lpb $2
add $3,$4
bin $3,$4
mod $3,$4
cmp $3,0
equ $3,0
sub $0,$3
add $1,1
sub $2,$0
Expand Down
12 changes: 7 additions & 5 deletions oeis/003/A003070.asm
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
; A003070: a(n) = ceiling(log_2 n!).
; Submitted by Science United
; Submitted by Coleslaw
; 0,0,1,3,5,7,10,13,16,19,22,26,29,33,37,41,45,49,53,57,62,66,70,75,80,84,89,94,98,103,108,113,118,123,128,133,139,144,149,154,160,165,170,176,181,187,192,198,203,209,215,220,226,232,238,243,249,255,261,267,273,279,285,290,296,303,309,315,321,327,333,339,345,351,358,364,370,376,383,389

seq $0,33312 ; a(n) = n! - 1.
mov $1,4
lpb $0
div $0,2
add $1,2
mul $1,$0
sub $0,1
lpe
sub $1,1
log $1,2
mov $0,$1
div $0,2
sub $0,1
22 changes: 10 additions & 12 deletions oeis/003/A003623.asm
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
; A003623: Wythoff AB-numbers: floor(floor(n*phi^2)*phi), where phi = (1+sqrt(5))/2.
; Submitted by Science United
; Submitted by Matthias Lehmkuhl
; 3,8,11,16,21,24,29,32,37,42,45,50,55,58,63,66,71,76,79,84,87,92,97,100,105,110,113,118,121,126,131,134,139,144,147,152,155,160,165,168,173,176,181,186,189,194,199,202,207,210,215,220,223,228,231,236,241,244,249,254,257,262,265,270,275,278,283,288,291,296,299,304,309,312,317,320,325,330,333,338

add $0,1
mov $2,$0
add $2,$0
mul $2,2
add $2,$0
mul $2,$0
nrt $2,2
add $2,$0
mov $1,$2
div $1,2
add $0,$1
mov $1,$0
mul $1,4
add $1,$0
mov $0,$1
mul $1,$0
nrt $1,2
add $1,$0
mov $2,$1
div $2,2
add $0,$2
add $0,$2
21 changes: 9 additions & 12 deletions oeis/004/A004020.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; A004020: Theta series of square lattice with respect to edge.
; Submitted by Time_Traveler
; Submitted by [AF>Amis de la Mer] ComteZera
; 2,4,2,4,4,0,6,4,0,4,4,4,2,4,0,4,8,0,4,0,2,8,4,0,4,4,0,4,4,4,2,8,0,0,4,0,8,4,4,4,0,0,6,4,0,4,8,0,4,4,0,8,0,0,0,8,6,4,4,0,4,4,0,0,4,4,8,4,0,4,4,0,6,4,0,0,8,0,4,4

mov $3,3
Expand All @@ -9,21 +9,18 @@ lpb $0
sub $0,$3
mov $2,$0
max $2,0
mov $5,$2
mul $5,4
mov $6,$5
mul $2,4
mov $6,$2
nrt $6,2
mul $2,2
add $2,1
mul $2,2
mov $7,$2
nrt $7,2
add $6,$7
mov $2,$6
add $2,2
mov $5,$2
nrt $5,2
mov $2,$5
add $2,$6
mod $2,2
add $1,$2
mov $3,2
add $3,$4
add $1,$2
add $4,2
lpe
mov $0,$1
Expand Down
1 change: 0 additions & 1 deletion oeis/004/A004117.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
; Submitted by ChelseaOilman
; 1,1,2,14,35,91,728,1976,5434,135850,380380,1071980,9111830,25933670,74096200,637227320,1832028545,5280552865,137294374490,397431084050,1152550143745,10043651252635,29217894553120,85112997176480,744738725294200,2174637077859064,6356631458357264,502173885210223856,1470652092401369864,4310531994969532360,37932681555731884768,111350774889406500448,327092901237631595066,2884364674550024065582,8483425513382423722300,24965509367953989811340,661585998250780730000510,1948996589441489177569070

mov $2,0
mov $1,1
mov $3,$0
mov $0,6
Expand Down
24 changes: 11 additions & 13 deletions oeis/004/A004937.asm
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
; A004937: a(n) = round(n*phi^2), where phi is the golden ratio, A001622.
; Submitted by den777
; Submitted by Mads Nissen
; 0,3,5,8,10,13,16,18,21,24,26,29,31,34,37,39,42,45,47,50,52,55,58,60,63,65,68,71,73,76,79,81,84,86,89,92,94,97,99,102,105,107,110,113,115,118,120,123,126,128,131,134,136,139,141,144,147,149,152,154,157,160,162,165,168,170,173,175,178,181,183,186,188,191,194,196,199,202,204,207

mov $2,$0
add $2,$0
mul $2,2
add $2,$0
mul $2,$0
nrt $2,2
add $2,11
add $2,$0
mov $1,$2
div $1,2
mov $1,$0
mul $1,4
add $1,$0
mov $0,$1
sub $0,5
mul $1,$0
nrt $1,2
add $1,3
add $1,$0
mov $2,$1
div $2,2
add $0,$2
sub $0,1
27 changes: 12 additions & 15 deletions oeis/004/A004957.asm
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
; A004957: a(n) = ceiling(n*phi^2), where phi is the golden ratio, A001622.
; Submitted by Heijo
; Submitted by cemicle123
; 0,3,6,8,11,14,16,19,21,24,27,29,32,35,37,40,42,45,48,50,53,55,58,61,63,66,69,71,74,76,79,82,84,87,90,92,95,97,100,103,105,108,110,113,116,118,121,124,126,129,131,134,137,139,142,144,147,150,152,155,158,160,163,165,168,171,173,176,179,181,184,186,189,192,194,197,199,202,205,207

mov $2,$0
add $2,$0
mul $2,2
add $2,$0
mul $2,$0
nrt $2,2
add $2,$0
mov $1,$2
div $1,2
add $1,1
mov $1,$0
add $1,$0
lpb $1
div $1,3
mul $1,4
lpe
mul $1,2
add $1,$0
mul $1,$0
nrt $1,2
add $1,$0
mov $2,$1
div $2,2
add $2,1
add $2,$0
min $1,$2
mov $0,$1
2 changes: 1 addition & 1 deletion oeis/005/A005052.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; A005052: 10*3^n.
; A005052: a(n) = 10*3^n.
; 10,30,90,270,810,2430,7290,21870,65610,196830,590490,1771470,5314410,15943230,47829690,143489070,430467210,1291401630,3874204890,11622614670,34867844010,104603532030,313810596090,941431788270,2824295364810,8472886094430,25418658283290,76255974849870,228767924549610,686303773648830,2058911320946490,6176733962839470,18530201888518410,55590605665555230,166771816996665690,500315450989997070,1500946352969991210,4502839058909973630,13508517176729920890,40525551530189762670,121576654590569288010
; Formula: a(n) = 10*3^n

Expand Down
Loading

0 comments on commit 0435d83

Please sign in to comment.