login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A095100 Integers m of the form 4k+3 for which all sums Sum_{i=1..u} J(i/m) (with u ranging from 1 to (m-1)) are nonnegative, where J(i/m) is Jacobi symbol of i and m. 9

%I #23 Jul 20 2020 06:41:35

%S 3,7,11,15,23,27,31,35,39,47,55,59,63,71,75,79,83,87,95,103,111,119,

%T 131,135,143,151,159,167,171,175,183,191,199,215,231,239,243,251,255,

%U 263,271,279,287,295,299,303,311,319,327,335,343,351,359,363

%N Integers m of the form 4k+3 for which all sums Sum_{i=1..u} J(i/m) (with u ranging from 1 to (m-1)) are nonnegative, where J(i/m) is Jacobi symbol of i and m.

%C Integers whose Jacobi-vector forms a valid Motzkin-path.

%H Vincenzo Librandi, <a href="/A095100/b095100.txt">Table of n, a(n) for n = 1..1000</a>

%H A. Karttunen and J. Moyer, <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a>

%F a(n) = 4*A095274(n) + 3.

%t isMotzkin[n_, k_] := Module[{s = 0, r = True}, Do[s += JacobiSymbol[i, n]; If[s < 0, r = False; Break[]], {i, 1, k}]; r]; A095100[n_] := Select[4*Range[0, n+1]+3, isMotzkin[#, Quotient[#, 2]] &]; A095100[90] (* _Jean-François Alcover_, Oct 08 2013, translated from Sage *)

%o (Sage)

%o def is_Motzkin(n, k):

%o s = 0

%o for i in range(1, k + 1) :

%o s += jacobi_symbol(i, n)

%o if s < 0: return False

%o return True

%o def A095100_list(n):

%o return [m for m in range(3, n + 1, 4) if is_Motzkin(m, m // 2)]

%o A095100_list(363) # _Peter Luschny_, Aug 08 2012

%o (PARI) isok(m) = {if(m%4<3, return(0)); my(s=0); for(i=1, m-1, if((s+=kronecker(i, m))<0, return(0))); 1; } \\ _Jinyuan Wang_, Jul 20 2020

%Y Subset of A095102. Complement of A095101 in A004767.

%Y Cf. A095090.

%K nonn

%O 1,1

%A _Antti Karttunen_ and Jun 01 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 11:08 EDT 2024. Contains 371711 sequences. (Running on oeis4.)