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-3 of 3 results.

A218793 Numbers that can be written as p^2 + 3pq + q^2 with prime p and q.

Original entry on oeis.org

20, 31, 45, 59, 79, 95, 121, 125, 179, 191, 229, 245, 251, 295, 311, 389, 395, 401, 451, 479, 491, 541, 569, 605, 671, 695, 719, 745, 809, 845, 899, 971, 1019, 1061, 1109, 1111, 1121, 1151, 1249, 1271, 1301, 1409, 1445, 1451, 1499, 1595, 1619, 1661, 1711
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2012

Keywords

Comments

Sequence A218771 is the subsequence of primes in this sequence.

Examples

			a(1) = 20 = p^2+3pq+q^2 for p=q=2, in the same way all numbers of the form 5p^2 are member of the sequence.
a(2) = 31 = p^2+3pq+q^2 for p=2, q=3.
a(25) = 671 = p^2+3pq+q^2 for (p,q)=(2,23) and (5,19), is the least term to allow more than 1 decomposition.
a(1431) = 136895 = p^2+3pq+q^2 for (p,q)=(2,367), (67,277) and (103,233), is the least term to allow more than 2 decompositions.
		

Programs

  • Mathematica
    nf[{a_,b_}]:=a^2+3a*b+b^2; Take[Union[nf/@Tuples[Prime[Range[20]],2]],50] (* Harvey P. Dale, Mar 31 2015 *)
  • PARI
    is_A218793(n, v=0)={ /* set v=1 to count number of decompositions, and v=2 to print them */ my(r, c=0); forprime( q=1, sqrtint(n\5), issquare(4*n+5*q^2, &r) || next; isprime((r-3*q)/2) || next; v || return(1); v>1 & print1([q, (r-3*q)/2]", "); c++); c}

A218794 Numbers that can be written as p^2 + 3pq + q^2 with primes p < q.

Original entry on oeis.org

31, 59, 79, 95, 121, 179, 191, 229, 251, 295, 311, 389, 395, 401, 451, 479, 491, 541, 569, 671, 695, 719, 745, 809, 899, 971, 1019, 1061, 1109, 1111, 1121, 1151, 1249, 1271, 1301, 1409, 1451, 1499, 1595, 1619, 1661, 1711, 1919, 1931, 1949, 1991, 2059, 2105, 2111, 2141, 2195, 2201, 2245
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2012

Keywords

Comments

This is a subsequence of A218793, with the restriction that p < q, excluding terms of the form 5p^2 unless they would have another decomposition of the given form.
Sequence A218771 is the subsequence of primes in this sequence.

Examples

			a(1) = 31 = p^2+3pq+q^2 for p=2, q=3.
a(20) = 671 = p^2+3pq+q^2 for (p,q)=(2,23) and (5,19) is the least term to allow more than 1 decomposition. See A218795 for more such terms.
		

Programs

  • Mathematica
    With[{nn=60},Take[Union[#[[1]]^2+3Times@@#+#[[2]]^2&/@Subsets[Prime[ Range[ Floor[nn/3]]],{2}]],nn]] (* Harvey P. Dale, Apr 08 2013 *)
  • PARI
    is_A218794(n, v=0)={ /* set v=1 to count number of decompositions, and v=2 to print them */ my(r, c=0); forprime( q=1, sqrtint((n-1)\5), issquare(4*n+5*q^2, &r) || next; isprime((r-3*q)/2) || next; v || return(1); v>1 && print1([q, (r-3*q)/2]", "); c++); c}

A218795 Numbers that can be written in more than 1 way as p^2 + 3pq + q^2 with primes p < q.

Original entry on oeis.org

671, 1595, 3629, 3839, 4661, 4895, 5771, 8459, 11495, 13079, 17951, 19829, 21251, 22895, 23411, 34751, 40211, 40799, 43829, 45791, 46031, 47795, 49001, 53009, 57209, 57959, 60119, 60491, 64829, 67595, 70661, 78755, 83201, 89249, 98879
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2012

Keywords

Comments

According to the comment in A218771, there is no prime in this sequence.
The subsequence of terms allowing more than 2 decompositions of the given form starts 136895, 266741, 716441, 902495, 941501, 963281, 1003295, 1033241, 1236539, 1245431, 1439345, 1463495, 1692995, 2300045, 2430461, 3016145, 3238289,...

Examples

			a(1) = 671 = p^2+3pq+q^2 for (p,q)=(2,23) and (5,19), is the least term to allow more than 1 decomposition of the given form.
		

Crossrefs

Cf. A218794 for PARI code and further discussion.
Showing 1-3 of 3 results.