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.

Showing 1-4 of 4 results.

A095102 Odd primes p for which all sums Sum_{i=1..u} L(i/p) (with u ranging from 1 to (p-1)) are nonnegative, where L(i/p) is Legendre symbol of i and p, defined to be 1 if i is a quadratic residue (mod p) and -1 if i is a quadratic non-residue (mod p).

Original entry on oeis.org

3, 7, 11, 23, 31, 47, 59, 71, 79, 83, 103, 131, 151, 167, 191, 199, 239, 251, 263, 271, 311, 359, 383, 419, 431, 439, 479, 503, 563, 599, 607, 647, 659, 719, 743, 751, 839, 863, 887, 911, 919, 971, 983, 991, 1031, 1039, 1063, 1091, 1103, 1151
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Comments

All 4k+3 primes whose Legendre-vector (cf. A055094) forms a valid Dyck-path (cf. A014486).

Crossrefs

Intersection of A000040 and A095100. Subset of A080114 (see comments there). Complement of A095103 in A002145.
Cf. A095092.

Programs

  • Mathematica
    isMotzkin[n_, k_] := Module[{s = 0, r = True}, Do[s += JacobiSymbol[i, n]; If[s < 0, r = False; Break[]], {i, 1, k}]; r]; A095102[max_] := Select[ Range[3, max, 4], PrimeQ[#] && isMotzkin[#, Quotient[#, 2]]&]; A095102[1151] (* Jean-François Alcover, Feb 16 2018, after Peter Luschny *)
  • PARI
    isok(m) = {if(!isprime(m-(m<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
  • Sage
    def A095102_list(n) :
        def is_Motzkin(n, k):
            s = 0
            for i in (1..k):
                s += jacobi_symbol(i, n)
                if s < 0: return False
            return True
        P = filter(is_prime, range(3, n+1, 4))
        return filter(lambda m: is_Motzkin(m, m//2), P)
    A095102_list(1151) # Peter Luschny, Aug 09 2012
    

Formula

a(n) = 4*A095272(n) + 3.

A095008 Number of 4k+3 primes (A002145) in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 1, 1, 3, 3, 7, 13, 22, 37, 71, 128, 231, 440, 807, 1519, 2872, 5371, 10204, 19341, 36759, 70179, 134241, 256856, 492936, 947272, 1822615, 3513691, 6781495, 13103816, 25348667, 49092241, 95168205, 184661253, 358636497, 697094872, 1356052491, 2639893495, 5142817901
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A036378(n) - A095007(n) = A095010(n) + A095012(n) = A095092(n) + A095093(n).

Extensions

a(34)-a(38) from Amiram Eldar, Jun 12 2024

A095093 Number of 4k+3 primes whose Legendre-vector is not Dyck-path (A095103) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 6, 12, 21, 41, 77, 143, 287, 530, 1010, 1967, 3711, 7125, 13806, 26525, 51126
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Cf. A095103.

Programs

  • PARI
    is(m) = {my(s=0); if(isprime(m), for(i=1, m-1, if((s+=kronecker(i, m))<0, return(1)))); 0; }
    a(n) = {my(c=0); forstep(m=2^n+3, 2^(n+1), 4, c+=is(m)); c; } \\ Jinyuan Wang, Jul 20 2020

Formula

a(n) = A095008(n) - A095092(n).

A095090 Number of 4k+3 integers in range ]2^n,2^(n+1)] whose Jacobi-vector is a Motzkin-path (A095100).

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 17, 33, 60, 108, 202, 360, 703, 1328, 2519, 4779, 9103, 17501, 33473, 64761
Offset: 1

Views

Author

Antti Karttunen and Jun 01 2004

Keywords

Crossrefs

Programs

  • PARI
    is(m) = {my(s=0); for(i=1, m-1, if((s+=kronecker(i, m))<0, return(0))); 1; }
    a(n) = {my(c=0); forstep(m=2^n+3-(n==1), 2^(n+1), 4, c+=is(m)); c; } \\ Jinyuan Wang, Jul 20 2020

Formula

a(n) = 2^(n-2) - A095091(n) for n > 1.
Showing 1-4 of 4 results.