login
a(n) = ceiling(2*sqrt(A000037(n))), n >= 1.
7

%I #43 Feb 29 2024 11:22:59

%S 3,4,5,5,6,6,7,7,7,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,11,12,12,12,

%T 12,12,13,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,15,15,15,16,16,

%U 16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20

%N a(n) = ceiling(2*sqrt(A000037(n))), n >= 1.

%C This sequence a(n) = f(D(n)) := ceiling(sqrt(4*D(n))), with D(n) > 0, not a square, given in A000037, is important i) for finding out whether an indefinite binary quadratic form with discriminant 4*D(n) is reduced and also ii) for finding the principal reduced form for discriminant 4*D(n). See the W. Lang link under A225953 for the definition of reduced in eq. (1), and the principal reduced form [1, b(n), - (D(n) - (b(n)/2)^2] with eq. b(n) given in eq. (5) (there the discriminant D = 4*D(n)).

%C Even a(n) appear (a(n) - 2)/2 times, odd a(n) appear (a(n) - 1)/2 times. See the second formula below.

%C Middle side of integer-sided triangles whose sides a < b < c are in arithmetic progression. For the corresponding triples and miscellaneous properties and references, see A336750. - _Bernard Schott_, Oct 07 2020

%H Paolo Xausa, <a href="/A307136/b307136.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = ceiling(2*sqrt(A000037(n))), n >= 1.

%F s(n):= floor((a(n)-1)/2) = A000194(n) = A000037(n) - n, for n >= 1. See a comment above for the multiplicity of a(n).

%F G.f.: (Theta2(0,x)/x^(1/4) + Theta3(0,x)+3)*x/(2*(1-x)) where Theta2 and Theta3 are Jacobi Theta functions. - _Robert Israel_, Mar 26 2019

%p seq(i$((i-2+(i mod 2))/2),i=3..20); # _Robert Israel_, Mar 26 2019

%t A307136[n_] := Ceiling[2*Sqrt[n+Round[Sqrt[n]]]]; Array[A307136, 100] (* or *)

%t Flatten[Array[ConstantArray[#, Floor[(#-1)/2]] &, 19, 3]] (* _Paolo Xausa_, Feb 29 2024 *)

%o (PARI) lista(nn) = for (n=1, nn, if (!issquare(n), print1(ceil(2*sqrt(n)), ", "))); \\ _Michel Marcus_, Mar 26 2019

%o (Python)

%o from math import isqrt

%o def A307136(n): return 1+isqrt((n+isqrt(n+isqrt(n))<<2)-1) # _Chai Wah Wu_, Jul 28 2022

%Y Cf. A000037, A000194, A225953, A336750.

%K nonn,easy

%O 1,1

%A _Wolfdieter Lang_, Mar 26 2019