Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A096396
a(n) = #{ 0 <= i <= n: K(n, i) = +1 } where K(n, i) is the Kronecker symbol.
7
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, 8, 10, 10, 14, 12, 18, 12, 18, 8, 20, 8, 21, 10, 12, 13, 28, 8, 42, 11, 18, 12, 26, 10, 29, 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
OFFSET
0,2
LINKS
FORMULA
From Reinhard Zumkeller, Mar 24 2012: (Start)
a(n) = A000010(n) - A096397(n) for n >= 2.
a(n) = A071961(n) + A096397(n). (End)
MAPLE
K := (n, k) -> NumberTheory:-KroneckerSymbol(n, k):
seq(nops(select(k -> K(n, k) = 1, [seq(0..n)])), n = 0..80);
# Peter Luschny, May 15 2024
MATHEMATICA
Table[Count[Table[KroneckerSymbol[n, k], {k, 0, n}], 1], {n, 0, 80}]
(* Peter Luschny, May 15 2024 *)
PROG
(PARI) a(n) = sum(i=0, n, if(kronecker(n, i) - 1, 0, 1))
(SageMath)
print([sum(kronecker(n, k) == 1 for k in range(n + 1)) for n in range(81)])
# Peter Luschny, May 16 2024
CROSSREFS
Cf. this sequence (#K(n,i)=1), A096397 (#K(n,i)=-1), A062830 (#K(n,i)=0).
Sequence in context: A029272 A153904 A128762 * A126307 A320838 A092332
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 06 2004
EXTENSIONS
Typo in definition fixed by Reinhard Zumkeller, Mar 24 2012
Offset set to 0, a(0) = 0 added, a(1) and name adapted by Peter Luschny, May 15 2024
STATUS
approved