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

A215113 a(n) is the number of different prime divisors of A214723(n).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 1, 3, 2, 3, 1, 2, 2, 2, 2, 3, 1, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 2, 2, 2, 2, 2, 3, 1, 3, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3
Offset: 1

Views

Author

Vladimir Shevelev, Aug 03 2012

Keywords

Comments

The records of a(n) are a(1)=1, a(3)=2, a(12)=3, a(132)=4,... Is the sequence unbounded?

Crossrefs

Programs

  • 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 &]; PrimeNu[Sort[Transpose[Select[Tally[t], #[[2]] == 1 &]][[1]]]] (* G. C. Greubel, May 16 2017 *)

Formula

a(n) = A001221(A214723(n)). - Michel Marcus, Feb 08 2016

A215174 a(n) is the least term of A214723 having n different prime divisors, or 0 if no such term exists.

Original entry on oeis.org

8, 18, 130, 6890, 254930, 3352570, 683351890, 45139676530, 2744959126130
Offset: 1

Views

Author

Keywords

Comments

Conjectures. 1) For every n, a(n)>0; 2) for n>=3, a(n)==0 (mod 10).
If 1) is true, then A215113 is unbounded.
The corresponding positions m=m(n) such that A214723(m)=a(n) are 1,3,12,132,2074,18625,2138668. m(8) exists and the calculations show that it is >= 24866450, although up to now the exact its value is unknown.

Crossrefs

Extensions

a(9) from Donovan Johnson, Aug 19 2012

A045636 Numbers of the form p^2 + q^2, with p and q primes.

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, 338, 365, 370, 386, 410, 458, 482, 530, 533, 538, 554, 578, 650, 698, 722, 818, 845, 850, 866, 890, 962, 965, 970, 986, 1010, 1058, 1082, 1130, 1202, 1250
Offset: 1

Views

Author

Keywords

Comments

A045698(a(n)) > 0. - Reinhard Zumkeller, Jul 29 2012
All terms greater than 8 are of the form 8k+2 or 8k+5 (A047617). - Giuseppe Melfi, Oct 06 2022

Examples

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

Crossrefs

A214723 is a subsequence. Complement: A214879.
Cf. A214511 (least number having n orderless representations as p^2 + q^2).
Cf. A047617.

Programs

  • Haskell
    import Data.List (findIndices)
    a045636 n = a045636_list !! (n-1)
    a045636_list = findIndices (> 0) a045698_list
    -- Reinhard Zumkeller, Jul 29 2012
    
  • Mathematica
    q=13; imax=Prime[q]^2; Select[Union[Flatten[Table[Prime[x]^2+Prime[y]^2, {x,q}, {y,x}]]], #<=imax&] (* Vladimir Joseph Stephan Orlovsky, Apr 20 2011 *)
    With[{nn=60},Take[Union[Total/@(Tuples[Prime[Range[nn]],2]^2)],nn]] (* Harvey P. Dale, Jan 04 2014 *)
  • PARI
    list(lim)=my(p1=vector(primepi(sqrt(lim-4)),i,prime(i)^2), t, p2=List()); for(i=1,#p1, for(j=i,#p1, t=p1[i]+p1[j];if(t>lim, break, listput(p2,t)))); vecsort(Vec(p2),,8) \\ Charles R Greathouse IV, Jun 21 2012
    
  • 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(k for k in nums if k <= limit))
    print(aupto(1251)) # Michael S. Branicky, Aug 13 2021

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

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

A242230 Primes p of the form p^2 + q + 1 where p < q are consecutive primes.

Original entry on oeis.org

61, 4561, 9511, 17299, 19471, 26737, 30109, 37447, 49957, 69439, 94561, 196699, 209311, 259603, 317539, 333517, 352249, 414097, 427069, 459013, 678157, 845491, 886429, 943819, 1027189, 1217719, 1410163, 1472587, 1647379, 2165323, 2200777, 2230549, 2603389
Offset: 1

Views

Author

K. D. Bajpai, May 08 2014

Keywords

Examples

			a(1) = 61 = 7^2 + 11 + 1: 61 is prime, 7 and 11 are consecutive primes.
a(2) = 4561 = 67^2 + 71 + 1: 4561 is prime, 67 and 71 are consecutive primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A242230:= proc()local k ; k:=(ithprime(x)^2+ithprime(x+1)+1); if  isprime(k) then RETURN (k); fi;end: seq(A242230 (),x=1..500);
  • Mathematica
    A242230 = {}; Do[p = Prime[n]^2 + Prime[n + 1] + 1; If[PrimeQ[p], AppendTo[A242230, p]], {n, 500}]; A242230
    Select[#[[1]]^2+#[[2]]+1&/@Partition[Prime[Range[300]],2,1],PrimeQ] (* Harvey P. Dale, Mar 28 2016 *)

A242231 Primes p of the form p^2 + q - 1 where p < q are consecutive primes.

Original entry on oeis.org

13, 31, 59, 307, 383, 557, 997, 1409, 1723, 3541, 5113, 5407, 6323, 6977, 8017, 10303, 19469, 52673, 94559, 109897, 151717, 158009, 187927, 193163, 249503, 274069, 326617, 361807, 383791, 419261, 427067, 546863, 573809, 592133, 636017, 684757, 735307, 738743
Offset: 1

Views

Author

K. D. Bajpai, May 08 2014

Keywords

Examples

			a(1) = 13 = 3^2 + 5 - 1: 13 is prime, 3 and 5 are consecutive primes.
a(2) = 31 = 5^2 + 7 - 1: 31 is prime, 5 and 7 are consecutive primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A242231:= proc()local k ; k:=(ithprime(x)^2+ithprime(x+1)-1);if  isprime(k) then RETURN (k); fi;end: seq(A242231 (),x=1..500);
  • Mathematica
    A242231 = {}; Do[p = Prime[n]^2 + Prime[n + 1] - 1; If[PrimeQ[p], AppendTo[A242231, p]], {n, 500}]; A242231
    Select[#[[1]]^2+#[[2]]-1&/@Partition[Prime[Range[250]],2,1],PrimeQ] (* Harvey P. Dale, Mar 05 2022 *)
Showing 1-7 of 7 results.