OFFSET
1,1
COMMENTS
Integers whose Jacobi-vector forms a valid Motzkin-path.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Antti Karttunen and J. Moyer, C-program for computing the initial terms of this sequence
FORMULA
a(n) = 4*A095274(n) + 3.
MATHEMATICA
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 *)
PROG
(Sage)
def is_Motzkin(n, k):
s = 0
for i in range(1, k + 1) :
s += jacobi_symbol(i, n)
if s < 0: return False
return True
def A095100_list(n):
return [m for m in range(3, n + 1, 4) if is_Motzkin(m, m // 2)]
A095100_list(363) # Peter Luschny, Aug 08 2012
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 01 2004
STATUS
approved