login
Integers 1 to 2*k followed by integers 1 to 2*k + 2 and so on.
9

%I #43 Oct 20 2018 19:44:14

%S 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 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 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 Integers 1 to 2*k followed by integers 1 to 2*k + 2 and so on.

%C From _Cino Hilliard_, Sep 13 2004: (Start)

%C 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 sqrt(7).=.2.+._3_................

%C ...............4..+._3_..........

%C .....................4..+._3_....

%C ...........................4.....

%C 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 is the natural fractal sequence of A002061; the corresponding natural interspersion is A194011; see A194029 for definitions. - _Clark Kimberling_, Aug 17 2011

%C 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 Reinhard Zumkeller, <a href="/A074294/b074294.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = n - 2*binomial(floor(1/2 + sqrt(n)), 2).

%F a(n^2 + n) = 2*n.

%F a(n) = n - 2 - floor(sqrt(n)+3/2)*floor(sqrt(n)-3/2). - _Mikael Aaltonen_, Jan 02 2015

%F 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 a(n) = n + A000194(n) - A053187(n). - _Robert Israel_, Jan 05 2015

%e From _Omar E. Pol_, May 29 2012: (Start)

%e Written as a triangle the sequence begins:

%e 1, 2;

%e 1, 2, 3, 4;

%e 1, 2, 3, 4, 5, 6;

%e 1, 2, 3, 4, 5, 6, 7, 8;

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14;

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16;

%e Row n has length 2*n = A005843(n). (End)

%p 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[n_] := n - 2*Binomial[Floor[1/2 + Sqrt[n]], 2] (* _Enrique PĂ©rez Herrero_, Apr 14 2010 *)

%t Table[Range[2n],{n,10}]//Flatten (* _Harvey P. Dale_, Oct 20 2018 *)

%o (PARI) {a(n) = n - 2 * binomial( floor( 1/2 + sqrt(n)), 2)}

%o (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 (Haskell)

%o import Data.List (inits)

%o a074294 n = a074294_list !! (n-1)

%o a074294_list = f $ inits [1..] where

%o f (xs:_:xss) = xs ++ f xss

%o -- _Reinhard Zumkeller_, Apr 14 2014

%Y Cf. A002061, A194011.

%Y Cf. A071797.

%Y Cf. A000194, A053187.

%K nonn,easy,tabf

%O 1,2

%A _Michael Somos_, Aug 20 2002