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-10 of 13 results. Next

A067076 Numbers k such that 2*k + 3 is a prime.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 10, 13, 14, 17, 19, 20, 22, 25, 28, 29, 32, 34, 35, 38, 40, 43, 47, 49, 50, 52, 53, 55, 62, 64, 67, 68, 73, 74, 77, 80, 82, 85, 88, 89, 94, 95, 97, 98, 104, 110, 112, 113, 115, 118, 119, 124, 127, 130, 133, 134, 137, 139, 140, 145, 152, 154, 155
Offset: 1

Views

Author

David Williams, Aug 17 2002

Keywords

Comments

The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004
n is in the sequence iff none of the numbers (n-3k)/(2k+1), 1 <= k <= (n-1)/5, is positive integer. - Vladimir Shevelev, May 31 2009
Zeta(s) = Sum_{n>=1} 1/n^s = 1/1 - 2^(-s) * Product_{p=prime=(2*A067076)+3} 1/(1 - (2*A067076+3)^(-s)). - Eric Desbiaux, Dec 15 2009
This sequence is a subsequence of A047949. - Jason Kimberley, Aug 30 2012

Crossrefs

Numbers n such that 2n+k is prime: A005097 (k=1), this seq(k=3), A089038 (k=5), A105760 (k=7), A155722 (k=9), A101448 (k=11), A153081 (k=13), A089559 (k=15), A173059 (k=17), A153143 (k=19). - Jason Kimberley, Sep 07 2012
Numbers n such that 2n-k is prime: A006254 (k=1), A098090 (k=3), A089253 (k=5), A089192 (k=7), A097069 (k=9), A097338 (k=11), A097363 (k=13), A097480 (k=15), A098605 (k=17), A097932 (k=19).

Programs

Formula

a(n) = A006254(n) - 2 = A086801(n+1)/2. [Corrected by M. F. Hasler, Feb 14 2024]
a(n) = A089253(n) - 4. - Giovanni Teofilatto, Dec 14 2003
Conjecture: a(n) = A008507(n) + n - 1 = A005097(n) - 1 = A102781(n+1) - 1. - R. J. Mathar, Jul 07 2009
a(n) = A179893(n) - A000040(n). - Odimar Fabeny, Aug 24 2010

Extensions

Offset changed from 0 to 1 in 2008: some formulas here and elsewhere may need to be corrected.

A130290 Number of nonzero quadratic residues modulo the n-th prime.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36, 39, 41, 44, 48, 50, 51, 53, 54, 56, 63, 65, 68, 69, 74, 75, 78, 81, 83, 86, 89, 90, 95, 96, 98, 99, 105, 111, 113, 114, 116, 119, 120, 125, 128, 131, 134, 135, 138, 140, 141, 146, 153, 155, 156, 158
Offset: 1

Views

Author

M. F. Hasler, May 21 2007

Keywords

Comments

Row lengths for formatting A063987 as a table: The number of nonzero quadratic residues modulo a prime p equals floor(p/2), or (p-1)/2 if p is odd. The number of squares including 0 is (p+1)/2, if p is odd (rows prime(i) of A096008 formatted as a table). In fields of characteristic 2, all elements are squares. For any m > 0, floor(m/2) is the number of even positive integers less than or equal to m, so a(n) also equals the number of even positive integers less than or equal to the n-th prime. For all n > 0, A130290(n+1) = A005097(n) = A102781(n+1) = A102781(n+1) = A130291(n+1)-1 = A111333(n+1)-1 = A006254(n)-1.
From Vladimir Shevelev, Jun 18 2016: (Start)
a(1)+2 and, for n >= 2, a(n)+1 is the smallest k such that there exists 0 < k_1 < k with the condition k_1^2 == k^2 (mod prime(n)).
Indeed, for n >= 2, if prime(n) = 4*t+1 then k = 2*t+1 = a(n)+1, since (2*t+1)^2 == (2*t)^2 (mod prime(n)) and there cannot be a smaller value of k; if prime(n) = 4*t-1, then k = 2*t = a(n)+1, since (2*t)^2 == (2*t-1)^2 (mod prime(n)). (End)
a(n) is the number of pairs (a,b) such that a + b = prime(n) with 1 <= a <= b. - Nicholas Leonard, Oct 02 2022

Examples

			a(1)=1 since the only nonzero element of Z/2Z equals its square.
a(3)=2 since 1=1^2=(-1)^2 and 4=2^2=(-2)^2 are the only nonzero squares in Z/5Z.
a(1000000) = 7742931 = (prime(1000000)-1)/2.
		

Crossrefs

Essentially the same as A005097.
Cf. A102781 (Number of even numbers less than the n-th prime), A063987 (quadratic residues modulo the n-th prime), A006254 (Numbers n such that 2n-1 is prime), A111333 (Number of odd numbers <= n-th prime), A000040 (prime numbers), A130291.
Appears in A217983. - Johannes W. Meijer, Oct 25 2012

Programs

Formula

a(n) = floor( A000040(n)/2 ) = #{ even positive integers <= A000040(n) }
a(n) = A055034(A000040(n)), n>=1. - Wolfdieter Lang, Sep 20 2012
a(n) = A005097(n-[n>1]) = A005097(max(n-1,1)). - M. F. Hasler, Dec 13 2019

A166100 Sum of those positive i <= 2n+1, for which J(i,2n+1)=+1. Here J(i,k) is the Jacobi symbol.

Original entry on oeis.org

1, 1, 5, 7, 27, 22, 39, 15, 68, 76, 63, 92, 250, 117, 203, 186, 165, 175, 333, 156, 410, 430, 270, 423, 1029, 357, 689, 440, 513, 767, 915, 504, 780, 1072, 759, 994, 1314, 725, 1155, 1343, 2187, 1577, 1360, 957, 1958, 1547, 1395, 1330, 2328, 1485, 2525
Offset: 0

Views

Author

Antti Karttunen, Oct 13 2009. Erroneous name corrected Oct 20 2009

Keywords

Comments

Note that this sequence is not equal to the sum of the quadratic residues of 2n+1 in range [1,2n+1], and thus NOT a bisection of A165898.

Examples

			For n=5, we get odd number 11 (2*5+1), and J(i,11) = 1,-1,1,1,1,-1,-1,-1,1,-1,0 when i ranges from 1 to 11, J(i,11) getting value 1 when i=1, 3, 4, 5 and 9, thus a(5)=22.
		

Crossrefs

Scheme-code for jacobi-symbol is given at A165601.

Programs

  • Mathematica
    Table[Total[Flatten[Position[JacobiSymbol[Range[2n+1],2n+1],1]]],{n,0,50}] (* Harvey P. Dale, Jun 19 2013 *)
  • Python
    from sympy import jacobi_symbol as J
    def a(n): return sum([i for i in range(1, 2*n + 2) if J(i, 2*n + 1)==1]) # Indranil Ghosh, Jun 12 2017

A166406 a(n) = A166405(n)-A166100(n).

Original entry on oeis.org

-1, 1, 0, 7, -27, 11, 0, 30, 0, 19, 0, 69, -250, 9, 0, 93, 0, 70, 0, 156, 0, 43, 0, 235, -1029, 102, 0, 220, 0, 177, 0, 126, 0, 67, 0, 497, 0, 50, 0, 395, -2187, 249, 0, 522, 0, 182, 0, 760, 0, 0, 0, 515, 0, 321, 0, 888, 0, 230, 0, 1190, -6655, 246, 0, 635, 0, 655, 0
Offset: 0

Views

Author

Antti Karttunen, Oct 21 2009, Oct 22 2009

Keywords

Comments

Zeros occur at (A166409(k)-1)/2. The negative terms occur at positions given by A046092 (see the comment at A166040).
Sum of those positive i <= 2n+1, for which J(i,2n+1)=-1 minus sum of those positive i <= 2n+1, for which J(i,2n+1)=+1. Here J(i,k) is the Jacobi symbol.

Crossrefs

A125615(n)=a(A102781(n)). Cf. A166100, A166407-A166409. The cases where a(i)/A005408(i) is not integer seem also to be given by A166101.

Programs

  • Python
    from sympy import jacobi_symbol as J
    def a(n):
        l=0
        m=0
        for i in range(1, 2*n + 2):
            if J(i, 2*n + 1)==-1: l+=i
            elif J(i, 2*n + 1)==1: m+=i
        return l - m
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 12 2017

A130291 Number of quadratic residues (including 0) modulo the n-th prime.

Original entry on oeis.org

2, 2, 3, 4, 6, 7, 9, 10, 12, 15, 16, 19, 21, 22, 24, 27, 30, 31, 34, 36, 37, 40, 42, 45, 49, 51, 52, 54, 55, 57, 64, 66, 69, 70, 75, 76, 79, 82, 84, 87, 90, 91, 96, 97, 99, 100, 106, 112, 114, 115, 117, 120, 121, 126, 129, 132, 135, 136, 139, 141, 142, 147, 154, 156, 157
Offset: 1

Views

Author

M. F. Hasler, May 21 2007

Keywords

Comments

The number of squares (quadratic residues including 0) modulo a prime p (sequence A096008 with every "1" prefixed by a "0") equals 1+floor(p/2), or ceiling(p/2) = (p+1)/2 if p is odd. (In fields of characteristic 2, all elements are squares.) See A130290(n)=A130291(n)-1 for number of nonzero residues. For all n>0, A130291(n+1) = A111333(n+1) = A006254(n) = A005097(n)-1 = A102781(n+1)-1 = A102781(n+1)-1 = A130290(n+1)-1.

Examples

			a(1)=2 since both elements of Z/2Z are squares.
a(3)=0 since 0=0^2, 1=1^2=(-1)^2 and 4=2^2=(-2)^2 are squares in Z/5Z.
a(1000000) = 7742932 = (p[1000000]+1)/2.
		

Crossrefs

Essentially the same as A006254.
Cf. A005097 (Odd primes - 1)/2, A102781 (Integer part of n#/(n-2)#/2#), A102781 (Number of even numbers less than the n-th prime), A063987 (quadratic residues modulo the n-th prime), A006254 (Numbers n such that 2n-1 is prime), A111333 (Number of odd numbers <= n-th prime), A000040 (prime numbers), A130290 (number of nonzero residues modulo primes).

Programs

Formula

a(n) = floor( A000040(n)/2 )+1

A062875 Records in A046112 (or A006339).

Original entry on oeis.org

1, 5, 25, 125, 3125, 15625, 390625, 1953125, 48828125, 6103515625, 30517578125, 3814697265625, 95367431640625, 476837158203125, 11920928955078125, 1490116119384765625, 186264514923095703125, 931322574615478515625, 116415321826934814453125
Offset: 1

Views

Author

Keywords

Comments

A111333 gives where records occur in A046112; A102781 gives where records occur in A006339.

Crossrefs

Programs

  • Python
    from sympy import prime
    def A062875(n): return 5**(prime(n)-1>>1) # Chai Wah Wu, Aug 02 2024

Formula

a(n) = A046112(A111333(n)) = A006339(A102781(n)).
a(n) = 5^(A111333(n)-1) = 5^A102781(n).

Extensions

Edited and extended by Ray Chandler, Jan 05 2012

A166405 Sum of those positive i <= 2n+1, for which J(i,2n+1)=-1. Here J(i,k) is the Jacobi symbol.

Original entry on oeis.org

0, 2, 5, 14, 0, 33, 39, 45, 68, 95, 63, 161, 0, 126, 203, 279, 165, 245, 333, 312, 410, 473, 270, 658, 0, 459, 689, 660, 513, 944, 915, 630, 780, 1139, 759, 1491, 1314, 775, 1155, 1738, 0, 1826, 1360, 1479, 1958, 1729, 1395, 2090, 2328, 1485, 2525, 2884
Offset: 0

Views

Author

Antti Karttunen, Oct 21 2009

Keywords

Examples

			For n=5, we get odd number 11 (2*5+1), and J(i,11) = 1,-1,1,1,1,-1,-1,-1,1,-1,0 when i ranges from 1 to 11, J(i,11) obtaining value -1 when i=2, 6, 7, 8 and 10, thus a(5)=33.
		

Crossrefs

A125615(n)=a(A102781(n)). Cf. A166100, A166406-A166408. The cases where a(i)/A005408(i) is not integer seem also to be given by A166101. This is NOT a bisection of A165898. Scheme-code for jacobi-symbol is given at A165601.

Programs

  • Mathematica
    Table[Total@ Select[Range[2n + 1], JacobiSymbol[#, 2n + 1]==-1 &], {n, 0, 100}] (* Indranil Ghosh, Jun 12 2017 *)
  • Python
    from sympy import jacobi_symbol as J
    def a(n): return sum(i for i in range(1, 2*n + 2) if J(i, 2*n + 1)==-1)
    # Indranil Ghosh, Jun 12 2017

A139791 Numbers n for which 2n is a multiple of A002326(n), the multiplicative order of 2 mod 2n+1.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36, 39, 41, 44, 48, 50, 51, 53, 54, 56, 63, 65, 68, 69, 74, 75, 78, 81, 83, 86, 89, 90, 95, 96, 98, 99, 105, 111, 113, 114, 116, 119, 120, 125, 128, 131, 134, 135, 138, 140, 141, 146, 153, 155, 156, 158, 165, 168, 170
Offset: 1

Views

Author

Vladimir Shevelev, May 21 2008, May 24 2008

Keywords

Comments

The sequence properly contains A005097. 170 is the first number which is not in A005097. One can prove that A002326(2^(2t-1)) = 4t. Thus if n=2^(2t-1), where, for any m>0, t=2^(m-1) then 2n is a multiple of A002326(n) while 2n+1 is a Fermat number which, as well known, is not always a prime.
The sequence is the union of A005097 and (A001567 - 1)/2. [Conjectured by Vladimir Shevelev, proved by Ray Chandler, May 26 2008]

References

  • Christopher Adler and Jean-Paul Allouche (2022), Finite self-similar sequences, permutation cycles, and music composition, Journal of Mathematics and the Arts, 16:3, 244-261, DOI: 10.1080/17513472.2022.2116745.

Crossrefs

Programs

  • Mathematica
    Select[Range[160], Divisible[2#, MultiplicativeOrder[2, 2#+1]] &] (* Amiram Eldar, Jun 28 2019 *)
  • PARI
    isok(n) = !(2*n % znorder(Mod(2, 2*n+1))); \\ Michel Marcus, Nov 02 2017

Extensions

Data extended up to a(68) = 170 to clarify distinction from A005097 and essentially identical sequences A130290 and A102781, by M. F. Hasler, Dec 13 2019

A166408 a(n) = floor(A166407(n)/3).

Original entry on oeis.org

-1, 0, 0, 1, -3, 1, 0, 2, 0, 1, 0, 3, -10, 0, 0, 3, 0, 2, 0, 4, 0, 1, 0, 5, -21, 2, 0, 4, 0, 3, 0, 2, 0, 1, 0, 7, 0, 0, 0, 5, -27, 3, 0, 6, 0, 2, 0, 8, 0, 0, 0, 5, 0, 3, 0, 8, 0, 2, 0, 10, -55, 2, 0, 5, 0, 5, 0, 2, 0, 3, 0, 10, 0, 0, 0, 7, 0, 4, 0, 10, 0, 1, 0, 11, -78, 2, 0, 2, 0, 5, 0, 8, 0, 2, 0
Offset: 0

Views

Author

Antti Karttunen, Oct 21 2009

Keywords

Comments

See the conjecture in A166407. If true, then a(i) = A166406(i)/A005408(i), whenever i is not in A166101.

Crossrefs

A165951(n)=a(A102781(n)) for n>=2.

Programs

  • Python
    from sympy import floor, jacobi_symbol as J
    def a(n):
        l=0
        m=0
        for i in range(1, 2*n + 2):
            if J(i, 2*n + 1)==-1: l+=i
            elif J(i, 2*n + 1)==1: m+=i
        return floor(3*((l - m)/(2*n + 1)))//3
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 12 2017

A085599 Number of pairs of coprimes (n-i,n+i), 1

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 3, 3, 3, 3, 5, 3, 6, 5, 4, 7, 8, 5, 9, 7, 6, 9, 11, 7, 10, 11, 9, 11, 14, 7, 15, 15, 10, 15, 12, 11, 18, 17, 12, 15, 20, 11, 21, 19, 12, 21, 23, 15, 21, 19, 16, 23, 26, 17, 20, 23, 18, 27, 29, 15, 30, 29, 18, 31, 24, 19, 33, 31, 22, 23, 35, 23, 36, 35, 20
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 06 2003

Keywords

Examples

			n=7: (7-2,7+2)=(5,9), (7-3,7+3)=(4,10), (7-4,7+4)=(3,11), (7-5,7+5)=(2,12), (7-6,7+6)=(1,13): only three are coprime: (5,9), (3,11) and (1,13), therefore a(7)=3.
		

Crossrefs

Programs

  • Maple
    A085599 := proc(n)
        local i,a;
        a := 0 ;
        for i from 2 to n-1 do
            if igcd(n-i,n+i) = 1 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Jul 09 2016

Formula

For n>1, a(n) = A055034(n) - ((-1)^n + 1)/2 = A000010(2*n)/2 - ((-1)^n + 1)/2. - Max Alekseyev, Jul 21 2016

Extensions

Definition corrected by Ray Chandler, Jul 09 2016
Showing 1-10 of 13 results. Next