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 25 results. Next

A086119 Numbers of the form p^3 + q^3, p, q primes.

Original entry on oeis.org

16, 35, 54, 133, 152, 250, 351, 370, 468, 686, 1339, 1358, 1456, 1674, 2205, 2224, 2322, 2540, 2662, 3528, 4394, 4921, 4940, 5038, 5256, 6244, 6867, 6886, 6984, 7110, 7202, 8190, 9056, 9826, 11772, 12175, 12194, 12292, 12510, 13498, 13718, 14364
Offset: 1

Views

Author

Hollie L. Buchanan II, Jul 11 2003

Keywords

Examples

			133 belongs to the sequence because it can be written as 2^3 + 5^3.
		

Crossrefs

Programs

  • Mathematica
    sumList[x_List, y_List] := Module[{t = {}}, Do[t = Union[t, x[[i]] + y], {i, Length[x]}];  t]; nn = 10; Select[sumList[Prime[Range[nn]]^3, Prime[Range[nn]]^3], # < Prime[nn]^3 &]

Extensions

More terms from Alexander Adamchuk, Nov 10 2006

A214511 Least number having n orderless representations as p^2 + q^2, where p and q are primes.

Original entry on oeis.org

8, 338, 2210, 10370, 202130, 229970, 197210, 81770, 18423410, 16046810, 12625730, 21899930, 9549410, 370247930, 416392730, 579994610, 338609570, 2155919090, 601741010, 254885930, 10083683090, 4690939370, 29207671610, 30431277890, 22264417370, 23231920010
Offset: 1

Views

Author

T. D. Noe, Jul 26 2012

Keywords

Comments

A045698(a(n)) = n and A045698(m) < n for m < a(n). - Reinhard Zumkeller, Jul 29 2012
a(53) = 3374376505370. a(52) and terms following a(53) are greater than 4*10^13. - Giovanni Resta, Jul 02 2018

Examples

			a(2) = 338 because 338 = 7^2 + 17^2 = 13^2 + 13^2 and 338 is the least number with this property.
		

Crossrefs

Cf. A016032 (p and q integers).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a214511 = (+ 1) . fromJust . (`elemIndex` a045698_list)
    -- Reinhard Zumkeller, Jul 29 2012
  • Mathematica
    nn = 10^6; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2, {i, Length[ps]}, {j, i, Length[ps]}]]; t = Select[t, # <= nn &]; t2 = Sort[Tally[t]]; u = Union[Transpose[t2][[2]]]; d = Complement[Range[u[[-1]]], u]; If[d == {}, nLim = u[[-1]], nLim = d[[1]]-1]; t3 = Table[Select[t2, #[[2]] == n &, 1][[1]], {n, nLim}]; Transpose[t3][[1]]

Extensions

a(21)-a(26) from Donovan Johnson, Jul 29 2012

A214723 Numbers of the form p^2 + q^2, with p and q prime, in exactly one way.

Original entry on oeis.org

8, 13, 18, 29, 34, 50, 53, 58, 74, 98, 125, 130, 146, 170, 173, 178, 194, 218, 242, 290, 293, 298, 314, 365, 370, 386, 458, 482, 530, 533, 538, 554, 698, 722, 818, 845, 850, 866, 962, 965, 970, 986, 1058, 1082, 1202, 1250, 1322, 1370, 1373, 1378, 1394, 1418
Offset: 1

Views

Author

J. Stauduhar, Jul 26 2012

Keywords

Comments

A045698(a(n)) = 1. - Reinhard Zumkeller, Jul 29 2012

Examples

			a(1) = 8 = 2^2 + 2^2, and no other p^2 + q^2 sums to 8.
Both 7^2 + 17^2 and 13^2 + 13^2 sum to 338, so 338 is not in this sequence.
		

Crossrefs

Subsequence of A045636 (numbers of the form p^2 + q^2).

Programs

  • Haskell
    import Data.List (elemIndices)
    a214723 n = a214723_list !! (n-1)
    a214723_list = elemIndices 1 a045698_list
    -- Reinhard Zumkeller, Jul 29 2012
  • Mathematica
    nn = 2000; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2, {i, Length[ps]}, {j, i, Length[ps]}]]; t = Select[t, # <= nn &]; Sort[Transpose[Select[Tally[t], #[[2]] == 1 &]][[1]]] (* T. D. Noe, Jul 26 2012 *)

A045698 Number of ways n can be written as the sum of two squares of primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0
Offset: 0

Views

Author

Keywords

Comments

a(A214879(n)) = 0; a(A045636(n)) > 0; a(A214723(n)) = 1; a(A214511(n)) = n and a(m) < n for m < A214511(n). - Reinhard Zumkeller, Jul 29 2012
The smallest value of n such that a(n) = 2 is 338. (This helps distinguish it from the characteristic function of A045636.) - Wesley Ivan Hurt, Jun 13 2013

Examples

			For example, a(29) = 1 because 29 = 2^2 + 5^2. a(3) = 0 because there is no way to write 3 as sum of two squares of primes.
		

Crossrefs

Programs

  • Haskell
    a045698 n = length $ filter (\x -> x > 0 && a010051' x == 1) $
    map (a037213 . (n -)) $
    takeWhile (<= div n 2) a001248_list
    -- Reinhard Zumkeller, Jul 29 2012
    
  • PARI
    a(n)=my(s=0,q);forprime(p=2,sqrtint(n\2),if(issquare(n-p^2,&q)&&isprime(q),s++));s \\ Charles R Greathouse IV, Jun 04 2014

Extensions

More terms from Erich Friedman

A124865 Numbers of the form p^2-q^2 with p > q prime.

Original entry on oeis.org

5, 16, 21, 24, 40, 45, 48, 72, 96, 112, 117, 120, 144, 160, 165, 168, 192, 240, 264, 280, 285, 288, 312, 336, 352, 357, 360, 408, 432, 480, 504, 520, 525, 528, 552, 600, 648, 672, 720, 768, 792, 816, 832, 837, 840, 888, 912, 936, 952, 957, 960, 1008, 1032, 1080
Offset: 1

Views

Author

Alexander Adamchuk, Nov 10 2006

Keywords

Comments

The only prime term is a(1) = 5.
All odd terms are of the form p^2-4.
All even terms are divisible by 8.
Numbers of the form (p^2-q^2)/8 (p, q odd primes, p>q) are listed in A124866.
Elliott & Richner call these "ans numbers". - Charles R Greathouse IV, Feb 17 2014

Crossrefs

Apart from a(1), a subsequence of A177713.
Cf. A045636 (numbers of the form p^2+q^2, p, q primes).
Cf. A124866 (numbers of the form (p^2-q^2)/8, p, q odd primes, p>q).

Programs

  • Mathematica
    With[{nn=60},Take[Union[#[[2]]^2-#[[1]]^2&/@Subsets[Prime[Range[nn]],{2}]],nn]] (* Harvey P. Dale, Aug 21 2015 *)
  • PARI
    is(n)=if(n%24, isprimepower(n+4)==2 || isprimepower(n+9)==2, fordiv(n/4,d, if(isprime(n/d/4+d) && isprime(n/d/4-d), return(1))); 0) \\ Charles R Greathouse IV, Feb 17 2014

Formula

a(n) >> n log n, see Luca. - Charles R Greathouse IV, Feb 17 2014

A143850 Numbers of the form (p^2 + q^2)/2, for odd primes p and q.

Original entry on oeis.org

9, 17, 25, 29, 37, 49, 65, 73, 85, 89, 97, 109, 121, 145, 149, 157, 169, 185, 193, 205, 229, 241, 265, 269, 277, 289, 325, 349, 361, 409, 425, 433, 445, 481, 485, 493, 505, 529, 541, 565, 601, 625, 661, 685, 689, 697, 709, 745, 769, 829, 841, 845, 853, 865
Offset: 1

Views

Author

T. D. Noe, Sep 03 2008

Keywords

Comments

The primes in this sequence are listed in A103739.
a(n) mod 4 = 1. See A227697 for related sequence. - Richard R. Forberg, Sep 22 2013
The squares of primes in this sequence form the subsequence A001248 \ {4}. - Bernard Schott, Jul 09 2022

Crossrefs

Cf. A075892 (a subsequence).

Programs

  • Mathematica
    Take[Union[Total[#]/2&/@(Tuples[Prime[Range[2,20]],2]^2)],60] (* Harvey P. Dale, Dec 28 2014 *)
  • PARI
    list(lim)=my(v=List(), p2); lim\=1; if(lim<9, lim=8); forprime(p=3, sqrtint(2*lim-9), p2=p^2; forprime(q=3, min(sqrtint(2*lim-p2), p), listput(v, (p2+q^2)/2))); Set(v) \\ Charles R Greathouse IV, Feb 14 2017

A086120 Natural numbers of the form p^3 - q^3, where p and q are primes.

Original entry on oeis.org

19, 98, 117, 218, 316, 335, 866, 988, 1206, 1304, 1323, 1854, 1946, 2072, 2170, 2189, 2716, 3582, 4570, 4662, 4788, 4886, 4905, 5308, 5402, 5528, 6516, 6734, 6832, 6851, 7254, 9970, 10586, 10836, 11824, 12042, 12140, 12159, 12222, 17530, 17624, 18268
Offset: 1

Views

Author

Hollie L. Buchanan II, Jul 11 2003

Keywords

Comments

To find all differences p^3 - q^3 less than N, it is required that all primes p and q up to sqrt(N/6) be tested.

Examples

			117 belongs to the sequence because it can be written as 5^3 - 2^3.
		

Crossrefs

Cf. A086119, A086121. Also see A045636, A045699.

Programs

  • Mathematica
    sumList[x_List, y_List] := (punchline = {}; Do[punchline = Union[punchline, x[[i]] + y], {i, Length[x]}]; punchline); posPart[x_List] := (punchline = {}; Do[If[x[[i]] > 0, punchline = Union[punchline, {x[[i]]}]], {i, Length[x]}]; punchline); posPart[sumList[Prime[Range[10]]^3, - Prime[Range[10]]^3]]
    nn=10^5; Union[Reap[Do[n=Prime[i]^3-Prime[j]^3; If[n<=nn, Sow[n]], {i,PrimePi[Sqrt[nn/6]]}, {j,i-1}]][[2,1]]] (* T. D. Noe, Oct 04 2010 *)
    With[{upto=20000},Select[Abs[#[[1]]-#[[2]]]&/@Subsets[Prime[ Range[ Sqrt[ upto/6]]]^3,{2}]//Union,#<=upto&]] (* Harvey P. Dale, Dec 10 2017 *)

Extensions

Corrected by T. D. Noe, Oct 04 2010

A214515 Numbers of the form p^2 + q^2 + r^2 + s^2, where p, q, r, and s are primes.

Original entry on oeis.org

16, 21, 26, 31, 36, 37, 42, 47, 52, 58, 61, 63, 66, 68, 71, 76, 79, 82, 84, 87, 92, 100, 103, 106, 108, 111, 116, 124, 127, 132, 133, 138, 143, 148, 151, 154, 156, 159, 164, 172, 175, 178, 180, 181, 183, 186, 188, 191, 196, 199, 202, 204, 207, 212, 220, 223
Offset: 1

Views

Author

T. D. Noe, Jul 29 2012

Keywords

Crossrefs

Cf. A045636 (two primes), A214514 (three primes).

Programs

  • Mathematica
    nn = 10^3; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2 + ps[[k]]^2 + ps[[l]]^2, {i, Length[ps]}, {j, i, Length[ps]}, {k, j, Length[ps]}, {l, k, Length[ps]}]]; t = Select[t, # <= nn &]; Union[t]

A214879 Numbers that cannot be written as sum of the squares of two primes.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 29 2012

Keywords

Comments

A045698(a(n)) = 0.

Crossrefs

Cf. A045636 (complement).

Programs

  • Haskell
    import Data.List (elemIndices)
    a214879 n = a214879_list !! (n-1)
    a214879_list = elemIndices 0 a045698_list
    -- Reinhard Zumkeller, Jul 29 2012
    
  • PARI
    is(n)=forprime(p=2,sqrtint(n), if(isprimepower(n-p^2)==2, return(0))); 1 \\ Charles R Greathouse IV, Sep 01 2015
    
  • Python
    from sympy import primerange
    def aupto(limit):
        primes = list(primerange(2, int((limit-4)**.5)+2))
        nums = [p*p + q*q for i, p in enumerate(primes) for q in primes[i:]]
        return sorted(set(range(limit+1)) - set(k for k in nums if k <= limit))
    print(aupto(76)) # Michael S. Branicky, Aug 13 2021

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 01 2015

A086121 Positive sums or differences of two cubes of primes.

Original entry on oeis.org

16, 19, 35, 54, 98, 117, 133, 152, 218, 250, 316, 335, 351, 370, 468, 686, 866, 988, 1206, 1304, 1323, 1339, 1358, 1456, 1674, 1854, 1946, 2072, 2170, 2189, 2205, 2224, 2322, 2540, 2662, 2716, 3528, 3582, 4394, 4570, 4662, 4788, 4886, 4905, 4921, 4940, 5038
Offset: 1

Views

Author

Hollie L. Buchanan II, Jul 11 2003

Keywords

Examples

			117 and 133 each belong to the (set) sequence because can be written as 117 = 5^3 - 2^3 and 133 = 5^3 + 2^3.
		

Crossrefs

Cf. A086119, A086120. Also see A045636, A045699.

Programs

  • Mathematica
    nn=10^6; td=Reap[Do[n=Prime[i]^3-Prime[j]^3; If[n<=nn, Sow[n]], {i,PrimePi[Sqrt[nn/6]]}, {j,i-1}]][[2,1]]; ts=Reap[Do[n=Prime[i]^3+Prime[j]^3; If[n<=nn, Sow[n]], {i,PrimePi[nn^(1/3)]}, {j,i}]][[2,1]]; Union[td,ts] (* T. D. Noe, Oct 04 2010 *)
    n = 100; Select[Sort@Flatten@ Table[Prime[i]^3 + (-1)^k Prime[j]^3, {i, n}, {j, i}, {k, 2}], 0 < # < (Prime[n] + 2)^3 - Prime[n]^3 &] (* Ray Chandler, Oct 05 2010 *)

Extensions

Edited by N. J. A. Sloane, Oct 05 2010 to remove a discrepancy between the terms of the sequence and the b-file. The old Mma program and b-file were wrong.
Showing 1-10 of 25 results. Next