Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #25 May 17 2024 04:22:12
%S 0,2,1,1,2,2,2,5,2,6,3,6,2,6,5,7,8,8,3,10,4,6,6,14,4,20,9,9,6,14,6,21,
%T 8,10,10,14,12,18,12,18,8,20,8,21,10,12,13,28,8,42,11,18,12,26,10,29,
%U 12,18,15,32,8,30,19,19,32,24,14,32,16,22,14,42,12,36,23,22,18,30,14,50,16
%N a(n) = #{ 0 <= i <= n: K(n, i) = +1 } where K(n, i) is the Kronecker symbol.
%H Reinhard Zumkeller, <a href="/A096396/b096396.txt">Table of n, a(n) for n = 0..10000</a>
%F From _Reinhard Zumkeller_, Mar 24 2012: (Start)
%F a(n) = A000010(n) - A096397(n) for n >= 2.
%F a(n) = A071961(n) + A096397(n). (End)
%p K := (n, k) -> NumberTheory:-KroneckerSymbol(n, k):
%p seq(nops(select(k -> K(n, k) = 1, [seq(0..n)])), n = 0..80);
%p # _Peter Luschny_, May 15 2024
%t Table[Count[Table[KroneckerSymbol[n, k], {k, 0, n}], 1], {n, 0, 80}]
%t (* _Peter Luschny_, May 15 2024 *)
%o (PARI) a(n) = sum(i=0, n, if(kronecker(n, i) - 1, 0, 1))
%o (SageMath)
%o print([sum(kronecker(n, k) == 1 for k in range(n + 1)) for n in range(81)])
%o # _Peter Luschny_, May 16 2024
%Y Cf. A000010, A051953, A071961.
%Y Cf. this sequence (#K(n,i)=1), A096397 (#K(n,i)=-1), A062830 (#K(n,i)=0).
%K nonn
%O 0,2
%A _Benoit Cloitre_, Aug 06 2004
%E Typo in definition fixed by _Reinhard Zumkeller_, Mar 24 2012
%E Offset set to 0, a(0) = 0 added, a(1) and name adapted by _Peter Luschny_, May 15 2024