A116729 Duplicate of A048840.
1, 2, 5, 12, 22, 34, 48, 64, 82, 102, 124, 148, 174, 202, 232, 264, 298, 334, 372, 412, 454, 498, 544, 592, 642, 694, 748, 804, 862, 922
Offset: 0
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
The start of the sequence as table: 1 2 5 10 17 26 ... 3 4 9 16 25 36 ... 7 8 6 11 18 27 ... 13 14 12 15 24 35 ... 21 22 20 23 19 28 ... 31 32 30 33 29 34 ... ... The start of the sequence as triangle array read by rows: 1; 2, 3; 5, 4, 7; 10, 9, 8, 13; 17, 16, 6, 14, 21; 26, 25, 11, 12, 22, 31; ...
t=int((math.sqrt(8*n-7) - 1)/ 2) i=n-t*(t+1)/2 j=(t*t+3*t+4)/2-n if i > j: result=i*i-i+(j%2)*(2-(j+1)/2)+((j+1)%2)*(j/2+1) else: result=j*j-2*(i%2)*j + (i%2)*((i+1)/2+1) + ((i+1)%2)*(-i/2+1)
Comments