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 A074294 #48 Jun 06 2025 14:47:22 %S A074294 1,2,1,2,3,4,1,2,3,4,5,6,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,9,10,1,2,3,4, %T A074294 5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8, %U A074294 9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,2 %N A074294 Integers 1 to 2*k followed by integers 1 to 2*k + 2 and so on. %C A074294 From _Cino Hilliard_, Sep 13 2004: (Start) %C A074294 Also the numerator of the fraction in the continued fraction expansion of sqrt(n) for nonsquare n = 2,3,5,6,7... . E.g., for n = 7, %C A074294 sqrt(7).=.2.+._3_................ %C A074294 ...............4..+._3_.......... %C A074294 .....................4..+._3_.... %C A074294 ...........................4..... %C A074294 3 is the 5th entry in the table. sqrt(1) and sqrt(4) are not included because 1 and 4 are squares." (End) %C A074294 A074294 is the natural fractal sequence of A002061; the corresponding natural interspersion is A194011; see A194029 for definitions. - _Clark Kimberling_, Aug 17 2011 %C A074294 It appears that this is also a triangle read by rows in which row n lists the first 2*n positive integers, n >= 1 (see example). - _Omar E. Pol_, May 29 2012 %H A074294 Reinhard Zumkeller, <a href="/A074294/b074294.txt">Table of n, a(n) for n = 1..1000</a> %F A074294 a(n) = n - 2*binomial(floor(1/2 + sqrt(n)), 2). %F A074294 a(n^2 + n) = 2*n. %F A074294 a(n) = n - 2 - floor(sqrt(n)+3/2)*floor(sqrt(n)-3/2). - _Mikael Aaltonen_, Jan 02 2015 %F A074294 G.f.: x/(1-x)^2 - (2*x/(1-x))*Sum_{k>=1} k*x^(k^2+k). That sum is related to Jacobi theta functions. - _Robert Israel_, Jan 05 2015 %F A074294 a(n) = n + A000194(n) - A053187(n). - _Robert Israel_, Jan 05 2015 %e A074294 From _Omar E. Pol_, May 29 2012: (Start) %e A074294 Written as a triangle the sequence begins: %e A074294 1, 2; %e A074294 1, 2, 3, 4; %e A074294 1, 2, 3, 4, 5, 6; %e A074294 1, 2, 3, 4, 5, 6, 7, 8; %e A074294 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; %e A074294 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12; %e A074294 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14; %e A074294 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16; %e A074294 Row n has length 2*n = A005843(n). (End) %p A074294 seq(seq((j-n^2-n),j=n^2+n+1..(n+1)^2+n+1),n=0..20); # _Robert Israel_, Jan 05 2015 %t A074294 A074294[n_] := n - 2*Binomial[Floor[1/2 + Sqrt[n]], 2] (* _Enrique Pérez Herrero_, Apr 14 2010 *) %t A074294 Table[Range[2n],{n,10}]//Flatten (* _Harvey P. Dale_, Oct 20 2018 *) %o A074294 (PARI) {a(n) = n - 2 * binomial( floor( 1/2 + sqrt(n)), 2)} %o A074294 (PARI) c(n) = for(x=2,n,if(issquare(x)==0,a=floor(sqrt(x));print1(x-a^2", "))) /* _Cino Hilliard_, Sep 13 2004 */ %o A074294 (Haskell) %o A074294 import Data.List (inits) %o A074294 a074294 n = a074294_list !! (n-1) %o A074294 a074294_list = f $ inits [1..] where %o A074294 f (xs:_:xss) = xs ++ f xss %o A074294 -- _Reinhard Zumkeller_, Apr 14 2014 %o A074294 (Python) %o A074294 from math import isqrt %o A074294 def A074294(n): return n+(k:=(m:=isqrt(n))+(n>m*(m+1)))*(1-k) # _Chai Wah Wu_, Jun 06 2025 %Y A074294 Cf. A002061, A194011. %Y A074294 Cf. A071797. %Y A074294 Cf. A000194, A053187. %K A074294 nonn,easy,tabf %O A074294 1,2 %A A074294 _Michael Somos_, Aug 20 2002