cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A226518 Irregular triangle read by rows: T(n,k) = Sum_{i=0..k} Legendre(i,prime(n)).

This page as a plain text file.
%I A226518 #48 Oct 06 2024 09:15:49
%S A226518 0,1,0,1,0,0,1,0,-1,0,0,1,2,1,2,1,0,0,1,0,1,2,3,2,1,0,1,0,0,1,0,1,2,1,
%T A226518 0,-1,-2,-1,0,-1,0,0,1,2,1,2,1,0,-1,0,1,0,-1,-2,-1,-2,-1,0,0,1,0,-1,0,
%U A226518 1,2,3,2,3,2,3,2,1,0,-1,0,1,0,0,1,2,3,4,3,4,3,4,5,4,3,4,5,4,3,4,3,4,3,2,1,0
%N A226518 Irregular triangle read by rows: T(n,k) = Sum_{i=0..k} Legendre(i,prime(n)).
%C A226518 Strictly speaking, the symbol in the definition is the Legendre-Jacobi-Kronecker symbol, since the Legendre symbol is defined only for odd primes.
%C A226518 The classical Polya-Vinogradov theorem gives an upper bound.
%C A226518 There is a famous open problem concerning upper bounds on |T(n,k)| for small k.
%D A226518 R. Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; p. 320, Theorem 5.1.
%D A226518 Beck, József. Inevitable randomness in discrete mathematics. University Lecture Series, 49. American Mathematical Society, Providence, RI, 2009. xii+250 pp. ISBN: 978-0-8218-4756-5; MR2543141 (2010m:60026). See page 23.
%D A226518 Elliott, P. D. T. A. Probabilistic number theory. I. Mean-value theorems. Grundlehren der Mathematischen Wissenschaften, 239. Springer-Verlag, New York-Berlin, 1979. xxii+359+xxxiii pp. (2 plates). ISBN: 0-387-90437-9 MR0551361 (82h:10002a). See Vol. 1, p. 154.
%H A226518 Alois P. Heinz, <a href="/A226518/b226518.txt">Rows n = 1..70, flattened</a>
%H A226518 D. A. Burgess, <a href="http://dx.doi.org/10.1112/S0025579300001157">The distribution of quadratic residues and non-residues</a>, Mathematika 4, 1957, 106--112. MR0093504 (20 #28)
%H A226518 Wikipedia, <a href="http://en.wikipedia.org/wiki/Legendre_symbol">Legendre symbol</a>.
%e A226518 Triangle begins:
%e A226518   0, 1;
%e A226518   0, 1, 0;
%e A226518   0, 1, 0, -1, 0;
%e A226518   0, 1, 2,  1, 2, 1, 0;
%e A226518   0, 1, 0,  1, 2, 3, 2,  1,  0,  1, 0;
%e A226518   0, 1, 0,  1, 2, 1, 0, -1, -2, -1, 0, -1,  0;
%e A226518   0, 1, 2,  1, 2, 1, 0, -1,  0,  1, 0, -1, -2, -1, -2, -1, 0;
%e A226518   0, 1, 0, -1, 0, 1, 2,  3,  2,  3, 2,  3,  2,  1,  0, -1, 0, 1, 0;
%e A226518   ...
%p A226518 with(numtheory);
%p A226518 T:=(n,k)->add(legendre(i,ithprime(n)),i=0..k);
%p A226518 f:=n->[seq(T(n,k),k=0..ithprime(n)-1)];
%p A226518 [seq(f(n),n=1..15)];
%t A226518 Table[p = Prime[n]; Table[JacobiSymbol[k, p], {k, 0, p-1}] // Accumulate, {n, 1, 15}] // Flatten (* _Jean-François Alcover_, Mar 07 2014 *)
%o A226518 (PARI) print("# A226518 ");
%o A226518 cnt=1; for(j5=1,9,summ=0; for(i5=0,prime(j5)-1, summ=summ+kronecker(i5,prime(j5)); print(cnt,"  ",summ); cnt++)); \\ _Bill McEachen_, Aug 02 2013
%o A226518 (Haskell)
%o A226518 a226518 n k = a226518_tabf !! (n-1) !! k
%o A226518 a226518_row n = a226518_tabf !! (n-1)
%o A226518 a226518_tabf = map (scanl1 (+)) a226520_tabf
%o A226518 -- _Reinhard Zumkeller_, Feb 02 2014
%o A226518 (Magma)
%o A226518 A226518:= func< n,k | n eq 1 select k else  (&+[JacobiSymbol(j, NthPrime(n)): j in [0..k]]) >;
%o A226518 [A226518(n,k) : k in [0..NthPrime(n)-1], n in [1..15]]; // _G. C. Greubel_, Oct 05 2024
%o A226518 (SageMath)
%o A226518 def A226518(n,k): return k if n==1 else sum(jacobi_symbol(j, nth_prime(n)) for j in range(k+1))
%o A226518 flatten([[A226518(n,k) for k in range(nth_prime(n))] for n in range(1,16)]) # _G. C. Greubel_, Oct 05 2024
%Y A226518 Partial sums of rows of triangle in A226520.
%Y A226518 See A226519 for another version.
%Y A226518 Third and fourth columns give A226914, A226915.
%Y A226518 See also A226523.
%Y A226518 Cf. A165477 (131071st row), A165582.
%K A226518 sign,tabf
%O A226518 1,13
%A A226518 _N. J. A. Sloane_, Jun 19 2013