login
Characteristic function for A003658 (fundamental discriminants of real quadratic fields).
3

%I #12 Jan 14 2024 02:26:42

%S 1,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,1,0,

%T 0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,

%U 1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,1,1

%N Characteristic function for A003658 (fundamental discriminants of real quadratic fields).

%H Antti Karttunen, <a href="/A290098/b290098.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.

%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/Pi^2 = 0.303963... (A104141). - _Amiram Eldar_, Jan 14 2024

%t Block[{nn = 105, t}, t = ConstantArray[0, nn]; ReplacePart[t, Map[# -> 1 &, Select[Range@ nn, NumberFieldDiscriminant@ Sqrt@ # == # &]]]] (* _Michael De Vlieger_, Aug 23 2017 *)

%o (PARI) A290098(n) = isfundamental(n);

%Y Cf. A003658, A086669, A104141.

%K nonn

%O 1

%A _Antti Karttunen_, Aug 22 2017