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.

Previous Showing 31-40 of 87 results. Next

A243761 Primes of the form p^2 + pq + q^2, where p and q are consecutive primes.

Original entry on oeis.org

19, 109, 433, 1327, 4567, 6079, 19687, 49927, 62233, 103813, 160087, 172801, 238573, 363313, 395323, 463363, 583447, 640333, 753007, 1145773, 1529413, 1728247, 1968301, 2056753, 2223967, 2317927, 2349679, 2413927, 3121201, 3577393, 4148953, 4298443
Offset: 1

Views

Author

K. D. Bajpai, Jun 10 2014

Keywords

Examples

			19 is in the sequence because 2^2 + 2*3 + 3^2 = 19 is prime: 2 and 3 are consecutive primes.
109 is in the sequence because 5^2 + 5*7 + 7^2 = 109 is prime: 5 and 7 are consecutive primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A243761:= proc() local k, p, q; p:=ithprime(n); q:=ithprime(n+1); k:=p^2 + p*q + q^2;  if isprime(k) then RETURN (k); fi; end: seq(A243761 (), n=1..500);
  • Mathematica
    Select[Table[Prime[n]^2 + Prime[n] Prime[n + 1] + Prime[n + 1]^2, {n, 500}], PrimeQ[#] &]
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def A243761_gen(): # generator of terms
        p, q = 2, 3
        while True:
            if isprime(r:=p*(p+q)+q**2):
                yield r
            p, q = q, nextprime(q)
    A243761_list = list(islice(A243761_gen(),20)) # Chai Wah Wu, Feb 27 2023

A373751 Array read by ascending antidiagonals: p is a term of row A(n) if and only if p is a prime and p is a quadratic residue modulo prime(n).

Original entry on oeis.org

2, 3, 3, 5, 7, 5, 2, 11, 13, 7, 3, 7, 19, 19, 11, 3, 5, 11, 29, 31, 13, 2, 13, 11, 23, 31, 37, 17, 5, 13, 17, 23, 29, 41, 43, 19, 2, 7, 17, 23, 31, 37, 59, 61, 23, 5, 3, 11, 19, 29, 37, 43, 61, 67, 29, 2, 7, 13, 17, 43, 43, 47, 53, 71, 73, 31, 3, 5, 13, 23, 19, 47, 53, 53, 67, 79, 79, 37
Offset: 1

Views

Author

Peter Luschny, Jun 28 2024

Keywords

Comments

p is a term of A(n) <=> p is prime and there exists an integer q such that q^2 is congruent to p modulo prime(n).

Examples

			Note that the cross-references are hints, not assertions about identity.
.
[ n] [ p]
[ 1] [ 2] [ 2,  3,  5,  7, 11, 13, 17, 19, 23, 29, ...  A000040
[ 2] [ 3] [ 3,  7, 13, 19, 31, 37, 43, 61, 67, 73, ...  A007645
[ 3] [ 5] [ 5, 11, 19, 29, 31, 41, 59, 61, 71, 79, ...  A038872
[ 4] [ 7] [ 2,  7, 11, 23, 29, 37, 43, 53, 67, 71, ...  A045373
[ 5] [11] [ 3,  5, 11, 23, 31, 37, 47, 53, 59, 67, ...  A056874
[ 6] [13] [ 3, 13, 17, 23, 29, 43, 53, 61, 79, 101, ..  A038883
[ 7] [17] [ 2, 13, 17, 19, 43, 47, 53, 59, 67, 83, ...  A038889
[ 8] [19] [ 5,  7, 11, 17, 19, 23, 43, 47, 61, 73, ...  A106863
[ 9] [23] [ 2,  3, 13, 23, 29, 31, 41, 47, 59, 71, ...  A296932
[10] [29] [ 5,  7, 13, 23, 29, 53, 59, 67, 71, 83, ...  A038901
[11] [31] [ 2,  5,  7, 19, 31, 41, 47, 59, 67, 71, ...  A267481
[12] [37] [ 3,  7, 11, 37, 41, 47, 53, 67, 71, 73, ...  A038913
[13] [41] [ 2,  5, 23, 31, 37, 41, 43, 59, 61, 73, ...  A038919
[14] [43] [11, 13, 17, 23, 31, 41, 43, 47, 53, 59, ...  A106891
[15] [47] [ 2,  3,  7, 17, 37, 47, 53, 59, 61, 71, ...  A267601
[16] [53] [ 7, 11, 13, 17, 29, 37, 43, 47, 53, 59, ...  A038901
[17] [59] [ 3,  5,  7, 17, 19, 29, 41, 53, 59, 71, ...  A374156
[18] [61] [ 3,  5, 13, 19, 41, 47, 61, 73, 83, 97, ...  A038941
[19] [67] [17, 19, 23, 29, 37, 47, 59, 67, 71, 73, ...  A106933
[20] [71] [ 2,  3,  5, 19, 29, 37, 43, 71, 73, 79, ...
[21] [73] [ 2,  3, 19, 23, 37, 41, 61, 67, 71, 73, ...  A038957
[22] [79] [ 2,  5, 11, 13, 19, 23, 31, 67, 73, 79, ...
[23] [83] [ 3,  7, 11, 17, 23, 29, 31, 37, 41, 59, ...
[24] [89] [ 2,  5, 11, 17, 47, 53, 67, 71, 73, 79, ...  A038977
[25] [97] [ 2,  3, 11, 31, 43, 47, 53, 61, 73, 79, ...  A038987
.
Prime(n) is a term of row n because for all n >= 1, n is a quadratic residue mod n.
		

Crossrefs

Family: A217831 (Euclid's triangle), A372726 (Legendre's triangle), A372877 (Jacobi's triangle), A372728 (Kronecker's triangle), A373223 (Gauss' triangle), A373748 (quadratic residue/nonresidue modulo n).
Cf. A374155 (column 1), A373748.

Programs

  • Maple
    A := proc(n, len) local c, L, a; a := 2; c := 0; L := NULL; while c < len do if NumberTheory:-QuadraticResidue(a, n) = 1 and isprime(a) then L := L,a; c := c + 1 fi; a := a + 1 od; [L] end: seq(print(A(ithprime(n), 10)), n = 1..25);
  • Mathematica
    f[m_, n_] := Block[{p = Prime@ m}, Union[ Join[{p}, Select[ Prime@ Range@ 22, JacobiSymbol[#, If[m > 1, p, 1]] == 1 &]]]][[n]]; Table[f[n, m -n +1], {m, 12}, {n, m, 1, -1}]
    (* To read the array by descending antidiagonals, just exchange the first argument with the second in the function "f" called by the "Table"; i.e., Table[ f[m -n +1, n], {m, 12}, {n, m, 1, -1}] *)
  • PARI
    A373751_row(n, LIM=99)={ my(q=prime(n)); [p | p <- primes([1,LIM]), issquare( Mod(p, q))] } \\ M. F. Hasler, Jun 29 2024
  • SageMath
    # The function 'is_quadratic_residue' is defined in A373748.
    def A373751_row(n, len):
        return [a for a in range(len) if is_quadratic_residue(a, n) and is_prime(a)]
    for p in prime_range(99): print([p], A373751_row(p, 100))
    

A354091 Fully multiplicative prime shift where the primes of the form 3k+2 are replaced by the next larger such prime, and primes of the form 3k and 3k+1 stay as they are.

Original entry on oeis.org

1, 5, 3, 25, 11, 15, 7, 125, 9, 55, 17, 75, 13, 35, 33, 625, 23, 45, 19, 275, 21, 85, 29, 375, 121, 65, 27, 175, 41, 165, 31, 3125, 51, 115, 77, 225, 37, 95, 39, 1375, 47, 105, 43, 425, 99, 145, 53, 1875, 49, 605, 69, 325, 59, 135, 187, 875, 57, 205, 71, 825, 61, 155, 63, 15625, 143, 255, 67, 575, 87, 385, 83, 1125
Offset: 1

Views

Author

Antti Karttunen, May 17 2022

Keywords

Comments

Permutation of odd numbers. Preserves the prime signature.

Examples

			The primes in A003627 are replaced by the next prime in that sequence, as: 2 -> 5 -> 11 -> 17 -> 23 -> 29 -> 41 -> ..., while other kinds of primes (A002476) stay intact, thus for 60 = 2^2 * 3^1 * 5^1, we have a(60) = 5^2 * 3^1 * 11^1 = 825.
		

Crossrefs

Cf. A354092 (left inverse), A354093 (inverse Möbius transform), A354094 (Möbius transform), A354095, A354096.
Cf. also A003961, A332818, A348746 for similar constructions.

Programs

  • PARI
    A354091(n) = { my(f=factor(n)); for(k=1,#f~, if(2==(f[k,1]%3), for(i=1+primepi(f[k,1]),oo,if(2==(prime(i)%3), f[k,1]=prime(i); break)))); factorback(f); };

Formula

Fully multiplicative with a(A003627(n)) = A003627(1+n), a(A007645(n)) = A007645(n).
For all n >= 1, A354092(a(n)) = n.
For all n >= 1, A046523(a(n)) = A046523(n) and A074941(a(n)) = A074941(n).

A139492 Primes of the form x^2 + 5x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

7, 37, 43, 67, 79, 109, 127, 151, 163, 193, 211, 277, 331, 337, 373, 379, 421, 457, 463, 487, 499, 541, 547, 571, 613, 631, 673, 709, 739, 751, 757, 823, 877, 883, 907, 919, 967, 991, 1009, 1033, 1051, 1087, 1093, 1117, 1129, 1171, 1201, 1213, 1297, 1303
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

Reduced form is [1, 3, -3]. Discriminant = 21. Class number = 2.
Values of the quadratic form are {0, 1, 3, 4} mod 6, so this is a subsequence of A002476. - R. J. Mathar, Jul 30 2008
It can be checked that the primes p of the form x^2 + n*x*y + y^2, n >= 3, where x and y are nonnegative, depend on n mod 6 as follows: n mod 6 = 0 => p mod 12 = {1,5}; n mod 6 = 1 => p mod 12 = {1,7}; n mod 6 = 2 => p mod 12 = {1}; n mod 6 = 3 => p mod 12 = {1,5,7,11}; n mod 6 = 4 => p mod 12 = {1}; n mod 6 = 5 => p mod 12 = {1,7}. - Walter Kehowski, Jun 01 2008

Examples

			a(1) = 7 because we can write 7 = 1^2 + 5*1*1 + 1^2.
		

References

  • Z. I. Borevich and I. R. Shafarevich, Number Theory.
  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.

Crossrefs

Primes in A243172.
For a list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.

Programs

  • Mathematica
    a = {}; w = 5; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a]
  • Sage
    # uses[binaryQF]
    # The function binaryQF is defined in the link 'Binary Quadratic Forms'.
    Q = binaryQF([1, 5, 1])
    print(Q.represented_positives(1303, 'prime')) # Peter Luschny, May 12 2021

A139502 Primes of the form x^2 + 22x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

241, 409, 601, 769, 1009, 1129, 1201, 1249, 1321, 1489, 1609, 1801, 2089, 2161, 2281, 2521, 2689, 3001, 3049, 3121, 3169, 3361, 3529, 3769, 3889, 4129, 4201, 4441, 4561, 4729, 4801, 4969, 5209, 5281, 5449, 5521, 5569, 5641, 5689, 5881, 6121, 6361, 6481
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

Also primes of the form x^2 + 120y^2. - T. D. Noe, Apr 29 2008
Also primes of the form x^2+240y^2. See A140633. - T. D. Noe, May 19 2008
In base 12, the sequence is 181, 2X1, 421, 541, 701, 7X1, 841, 881, 921, X41, E21, 1061, 1261, 1301, 13X1, 1561, 1681, 18X1, 1921, 1981, 1X01, 1E41, 2061, 2221, 2301, 2481, 2521, 26X1, 2781, 28X1, 2941, 2X61, 3021, 3081, 31X1, 3241, 3281, 3321, 3361, 34X1, 3661, 3821, 3901, where X is 10 and E is 11. Moreover, the discriminant is 340. - Walter Kehowski, Jun 01 2008

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(7000) | p mod 120 in {1, 49}]; // Vincenzo Librandi, Jul 28 2012
  • Mathematica
    QuadPrimes2[1, 0, 120, 10000] (* see A106856 *)

Formula

The primes are congruent to {1, 49} (mod 120). - T. D. Noe, Apr 29 2008

A376202 Number of pairs 1 <= x <= y <= n-1 such that gcd(x,n) = gcd(y,n) = gcd(x+y,n) = 1 and 1/x + 1/y == 1/(x+y) mod n.

Original entry on oeis.org

0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 18, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 36, 0, 24, 0, 0, 0, 42, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 60, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 60, 0, 0, 0, 96, 0, 0, 0, 0, 0, 102, 0, 0
Offset: 1

Views

Author

Tom Duff and N. J. A. Sloane, Oct 06 2024

Keywords

Comments

In general, 1/x + 1/y = 1/(x+y) is the wrong way to add fractions!
See A376203 for a(2*n-1)/2 and A376755 for a(6*n+1)/6.
From Robert Israel, Nov 06 2024: (Start)
If a(n) = 0 then a(m) = 0 whenever m is a multiple of n.
It appears that the primes p for which a(p) > 0 are A007645. (End)

Examples

			For n = 3 the a(3) = 2 solutions are (x,y) = (1,1) and (2,2).
For n = 7 the a(7) = 6 solutions are (x,y) = (1,2), (1,4), (2,4), (3,5), (3,6), (5,6).
		

Crossrefs

Programs

  • Maple
    a:=[];
    for n from 1 to 140 do
    c:=0;
    for y from 1 to n-1 do
    for x from 1 to y do
    if gcd(y,n) = 1 and gcd(x,n) = 1 and gcd(x+y,n) = 1  and (1/x + 1/y - 1/(x+y)) mod n = 0 then c:=c+1; fi;
    od: # od x
    od: # od y
    a:=[op(a),c];
    od: # od n
    a;
  • Python
    from math import gcd
    def A376202(n):
        c = 0
        for x in range(1,n):
            if gcd(x,n) == 1:
                for y in range(x,n):
                    if gcd(y,n)==gcd(z:=x+y,n)==1 and not (w:=z**2-x*y)//gcd(w,x*y*z)%n:
                        c += 1
        return c # Chai Wah Wu, Oct 06 2024

A045386 Primes congruent to {1, 2, 4} mod 7.

Original entry on oeis.org

2, 11, 23, 29, 37, 43, 53, 67, 71, 79, 107, 109, 113, 127, 137, 149, 151, 163, 179, 191, 193, 197, 211, 233, 239, 263, 277, 281, 317, 331, 337, 347, 359, 373, 379, 389, 401, 421, 431, 443, 449, 457, 463, 487, 491, 499, 541, 547, 557, 569, 571, 599, 613, 617, 631, 641, 653, 659, 673
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Rational primes that decompose in the field Q(sqrt(-7)). - N. J. A. Sloane, Dec 25 2017
All these primes can be represented by the binary quadratic form x^2 + xy + 2y^2. - Alonso del Arte, Jun 13 2014. Indeed, apart from the fact that 7 is missing, this appears to coincide with A045373. - N. J. A. Sloane, Jun 14 2014

References

  • Şaban Alaca & Kenneth S. Williams, Introductory Algebraic Number Theory. Cambridge: Cambridge University Press (2004) p. 48, Theorem 2.5.4.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(600) | p mod 7 in [1, 2, 4]]; // Vincenzo Librandi, Aug 11 2012
  • Mathematica
    Select[Prime[Range[300]], MemberQ[{1, 2, 4}, Mod[#, 7]] &] (* Vincenzo Librandi, Aug 11 2012 *)

A073641 a(1) = 2; a(n) = smallest prime not included earlier such that concatenation of two successive terms is a prime.

Original entry on oeis.org

2, 3, 7, 19, 13, 61, 31, 37, 67, 79, 103, 43, 73, 127, 139, 97, 151, 157, 109, 199, 181, 193, 163, 211, 229, 223, 241, 271, 277, 331, 283, 397, 337, 313, 307, 367, 457, 421, 349, 373, 379, 433, 439, 409, 463, 523, 487, 601, 541, 547, 499, 571, 673, 613, 577
Offset: 1

Views

Author

Amarnath Murthy, Aug 09 2002

Keywords

Comments

Conjecture: every prime besides 5 is in this list. - Gabriel Cunningham (gcasey(AT)mit.edu), Apr 11 2003
It appears that the terms belong to A007645. There are no primes of form 6k-1 in this sequence. - Alexander Adamchuk, Aug 15 2006
The above conjecture by Cunningham (Apr 11 2003) is false: Since a(2)=3 and a(3)=7 == 1 mod 6, all subsequent terms must also be 1 mod 6 because concatenations of numbers 1 mod 6 with 5 mod 6 are 0 mod 3. - Bob Selcoe, Aug 25 2015

Crossrefs

Programs

  • Maple
    N:= 10000: # to get all terms before the first one > N
    A[1]:= 2:
    Primes:= Vector(select(isprime,[seq(2*i+1 , i=1..floor((N-1)/2))])):
    Nprimes:= LinearAlgebra:-Dimension(Primes):
    Next:= Vector(Nprimes):
    Prev:= Vector(Nprimes):
    for i from 1 to Nprimes-1 do Next[i]:= i+1; Prev[i+1]:= i od:
    first:= 1:
    found:= true:
    for n from 2 while found do
      i:= first;
      found:= false;
      while i <> 0 do
        p:= Primes[i];
        if isprime(10^(1+ilog10(p))*A[n-1] + p) then
          found:= true;
          A[n]:= p;
          if i = first then first:= Next[first]
          else Next[Prev[i]]:= Next[i]
          fi;
          if Next[i] <> 0 then
            Prev[Next[i]]:= Prev[i]
          fi;
          break
        fi;
        i:= Next[i];
      od
    od:
    seq(A[i],i=1..n-2); # Robert Israel, Aug 25 2015
  • Mathematica
    t = {2}; Do[i = 2; While[! PrimeQ[FromDigits[Flatten[IntegerDigits[{Last[t], x = Prime[i]}]]]] || MemberQ[t, x], i++]; AppendTo[t, x], {54}]; t (* Jayanta Basu, Jul 03 2013 *)

Formula

a(n) = A075609(n) for n>1. - Alexander Adamchuk, Aug 15 2006

Extensions

More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 11 2003
Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 20 2003

A185046 Smallest prime p such that 2n+1 = p^3 - 2q for some odd prime q, or 0 if no such prime exists.

Original entry on oeis.org

5, 3, 5, 7, 13, 3, 13, 3, 5, 3, 3, 11, 0, 7, 5, 19, 37, 11, 5, 7, 5, 7, 37, 11, 5, 31, 53, 31, 13, 23, 5, 7, 5, 7, 13, 23, 13, 19, 5, 7, 421, 47, 5, 7, 5, 11, 13, 11, 5, 43, 5, 11, 61, 23, 5, 19, 5, 7, 5, 5, 53, 7, 17, 7, 13, 11, 13, 7, 113, 7, 373, 11, 17, 7
Offset: 1

Views

Author

Michel Lagneau, Apr 17 2013

Keywords

Comments

a(n) = 0 for n = 13, 171, 364, 1098, 2456, 3429, 6083, 7812, 9841, 12194, 14895, 17968,... and 2n+1 = 27, 343, 729,... is a class of cubes.
The corresponding primes q are in A224730.
Conjecture: The odd numbers different from a cube are of the form m = p^3 - 2q where p and q are prime numbers.
Remark: Its converse is false: there exists cubes m = c^3 that are in the sequence with the form c^3 = p^3 - 2q, where p-c = 2, and q of the form x^2 +x*y+y^2 (see A007645). For example: 5^3 = 7^3 - 2*109.

Examples

			a(4) = 7 because, for (p, q) = (7, 167) => 2*4+1 = 9 = 7^3 - 2*167 = 343 - 334 = 9.
		

Crossrefs

Programs

  • Maple
    for n from 3 by 2 to 200 do:
          jj:=0:
              for j from 1 to 10000 while (jj=0) do:
                 p:=ithprime(j):q:=(p^3-n)/2:
                 if q> 0 and type(q,prime)=true
                 then
                 jj:=1:printf(`%d, `,p):
                 else
                 fi:
             od:
                if jj=0 then
                printf(`%d, `,0):
                else
                fi:
         od:

A201477 Primes of the form 3n^2 + 4.

Original entry on oeis.org

7, 31, 79, 151, 367, 1087, 1327, 1879, 2887, 3271, 4111, 4567, 6079, 7207, 8431, 15991, 16879, 17791, 19687, 23767, 24847, 25951, 34351, 39679, 42487, 49927, 51487, 54679, 56311, 63079, 73951, 102679, 104911, 111751, 123631, 126079, 128551
Offset: 1

Views

Author

Vincenzo Librandi, Dec 02 2011

Keywords

Comments

Equivalently, generalized cuban primes of the form (x^3-y^3)/(x-y) with x=y+4 (cf. A002407, A007645). - N. J. A. Sloane, Jan 29 2013

Crossrefs

Cf. A002407. A subsequence of A007645. - N. J. A. Sloane, Jan 29 2013
Cf. A111052 (corresponding values of n). - Zak Seidov, Feb 04 2016

Programs

  • Magma
    [a: n in [0..400] | IsPrime(a) where a is 3*n^2+4];
    
  • Mathematica
    Select[Table[3n^2+4,{n,0,700}],PrimeQ]
  • PARI
    lista(nn) = {for (n=0, nn, if (isprime(p=3*n^2 + 4), print1(p, ", ")););} \\ Michel Marcus, Feb 04 2016

Formula

a(n) = 4 + 3*A111052(n)^2. - Zak Seidov, Feb 04 2016
Previous Showing 31-40 of 87 results. Next