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.
%I A237451 #17 Nov 05 2024 03:12:03 %S A237451 0,0,1,0,1,0,1,2,0,1,2,0,1,2,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3, %T A237451 4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,5,0,1,2,3,4,5,0, %U A237451 1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5 %N A237451 Zero-based column index to irregular tables organized as successively larger square matrices. %C A237451 With sequences constructed of successively larger square matrices (cf. A074279), a(n) will return the distance of n from the left edge of the matrix that n is located in, with 0 standing for the leftmost column (please see the Example section). %C A237451 A237452 gives the corresponding row index. %C A237451 A238013 and A121997 give these same row and column indices, starting the numbering with index 1. - M. F. Hasler, Feb 17 2014 %H A237451 Antti Karttunen, <a href="/A237451/b237451.txt">Table of squares with sizes 1x1 .. 30x30, flattened</a> %F A237451 a(n) = (A064866(n)-1) modulo A074279(n). %F A237451 a(n) = A121997(n)-1. - _M. F. Hasler_, Feb 16 2014 %e A237451 This irregular table begins as: %e A237451 0; %e A237451 0,1; %e A237451 0,1; %e A237451 0,1,2; %e A237451 0,1,2; %e A237451 0,1,2; %e A237451 0,1,2,3; %e A237451 0,1,2,3; %e A237451 0,1,2,3; %e A237451 0,1,2,3; %e A237451 0,1,2,3,4; %e A237451 0,1,2,3,4; %e A237451 0,1,2,3,4; %e A237451 0,1,2,3,4; %e A237451 0,1,2,3,4;... %o A237451 (Scheme) (define (A237451 n) (modulo (-1+ (A064866 n)) (A074279 n))) %o A237451 (Python) %o A237451 from sympy import integer_nthroot %o A237451 def A237451(n): return (n-(k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k-1)*((k<<1)-1)//6-1)%k # _Chai Wah Wu_, Nov 04 2024 %Y A237451 Cf. A002262, A064866, A074279, A237452, A237265. %K A237451 nonn,tabf,easy %O A237451 1,8 %A A237451 _Antti Karttunen_, Feb 08 2014