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.

A075577 k^2 is a term if k^2 + (k-1)^2 and k^2 + (k+1)^2 are primes.

Original entry on oeis.org

4, 25, 625, 900, 1225, 4900, 7225, 10000, 12100, 50625, 52900, 67600, 81225, 84100, 102400, 152100, 168100, 225625, 240100, 245025, 265225, 348100, 462400, 483025, 504100, 562500, 577600, 714025, 902500, 1166400, 1210000, 1288225, 1380625, 1416100, 1428025
Offset: 1

Views

Author

Amarnath Murthy, Sep 25 2002

Keywords

Comments

For a(2) onwards, a(n) == 0 (mod 25).

Examples

			900 = 30^2 is a term because 30^2 + 29^2 = 1741 is prime and 30^2 + 31^2 = 1861 is prime.
		

Crossrefs

Cf. A109306.

Programs

  • Mathematica
    Do[s=n^2+(n-1)^2; s1=n^2+(n+1)^2; If[PrimeQ[s]&&PrimeQ[s1], Print[n^2]], {n, 1, 5000}]
  • Python
    from sympy import isprime
    def aupto(limit):
      alst, is2 = [], False
      for k in range(1, int(limit**.5) + 2):
        is1, is2 = is2, isprime(k**2 + (k+1)**2)
        if is1 and is2: alst.append(k**2)
      return alst
    print(aupto(1500000)) # Michael S. Branicky, Apr 25 2021

Formula

a(n) = A109306(n)^2. - David A. Corneth, Apr 25 2021

Extensions

More terms from Labos Elemer, Sep 27 2002
a(34) and beyond from Michael S. Branicky, Apr 25 2021

A261803 a(n) is the smallest number satisfying a(n)^2+1 = p(n)*q(n), p(n) < q(n) both prime, such that q(n+1)/p(n+1) < q(n)/p(n) with the initial condition q(1)/p(1) < 3/2.

Original entry on oeis.org

50, 334, 516, 670, 844, 1164, 1250, 1800, 2450, 9800, 14450, 20000, 24200, 101250, 105800, 135200, 162450, 168200, 204800, 304200, 336200, 451250, 480200, 490050, 530450, 696200, 924800, 966050, 1008200, 1125000, 1155200, 1428050, 1805000, 2332800, 2420000
Offset: 1

Views

Author

Michel Lagneau, Sep 01 2015

Keywords

Comments

The sequence is probably infinite. [This follows from Schinzel's hypothesis H, for example. - Charles R Greathouse IV, Aug 31 2021]
A majority of numbers in the sequence are of the form 2*q^2 with q = 5, 25, 30, 35, 70, 85, 100, 110, 225, 230, 260, 285, 290, 320, 390, 410, ... So, it seems that {a(n)} = {334, 516, 670, 844, 1164} union {2*A109306(n)^2} where A109306 are the numbers k such that k^2 + (k-1)^2 and k^2 + (k+1)^2 are both primes.

Examples

			a(1) = 50 because 50^2+1 = 41*61 => 61/41 = 1.4878... < 1.5
a(2) = 334 because 334^2+1 = 281*397 => 397/281 = 1.4128... < 1.4878...
a(3) = 516 because 516^2+1 = 449*593 => 593/449 = 1.3207... < 1.4128...
a(4) = 670 because 670^2+1 = 593*757 => 757/593 = 1.2765... < 1.3207...
		

Crossrefs

Subsequence of A085722.

Programs

  • Maple
    with(numtheory):nn:=100:d:=1.5:
    for n from 1 to nn do:
      x:=factorset(n^2+1):n0:=bigomega(n^2+1):
       if n0=2
       then
       q:=evalf(x[2]/x[1]):
       if q
    				
  • Mathematica
    (* Assumption: n>7 ==> a(n)=0 mod 50 *) a[n_] := a[n] = For[k = Which[n==1, 0, n <= 7, a[n-1]+1, True, a[n-1] + 50], True, k = Which[n <= 7, k+1, k == a[n-1]+1, k+49, True, k+50], f = FactorInteger[k^2+1]; If[Length[f] == 2, If[f[[All, 2]] == {1, 1}, {p1, q1} = f[[All, 1]]; If[q1/p1 < If[n == 1, 3/2, q[n-1]/p[n-1]], p[n] = p1; q[n] = q1; Return[k]]]]]; Table[Print["a(", n, ") = ", a[n], "  p = ", p[n], "  q = ", q[n],  "  q/p = ", N[q[n]/p[n], 10], "  q-p = ", q[n]-p[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Sep 28 2015 *)

A348594 Numbers m such that m^2 + 1 = p*q with p, q primes and m = (p + q)/2 - 1.

Original entry on oeis.org

8, 50, 1250, 1800, 2450, 9800, 14450, 20000, 24200, 101250, 105800, 135200, 162450, 168200, 204800, 304200, 336200, 451250, 480200, 490050, 530450, 696200, 924800, 966050, 1008200, 1125000, 1155200, 1428050, 1805000, 2332800, 2420000, 2576450, 2761250, 2832200
Offset: 1

Views

Author

Michel Lagneau, Jan 26 2022

Keywords

Comments

Subsequence of A085722.
The corresponding pairs (p, q) of the sequence are (5, 13), (41, 61), (1201, 1301), (1741, 1861), (2381, 2521), (9661, 9941), (14281, 14621), (19801, 20201), (23981, 24421), (100801, 101701), ...
Property:
a(n) = 2* A109306(n)^2 and a(n) == 0 (mod 50) for n > 1. Proof:
From the relations:
(1) m^2 + 1 = p*q
(2) (p + q)/2 = m + 1
We obtain:
(3) p = m + 1 - sqrt(8*m)/2
(4) q = m + 1 + sqrt(8*m)/2
with m = 2*k^2 we obtain:
(5) p = k^2 + (k-1)^2
(6) q = k^2 + (k+1)^2
For n > 1, A109306(n) == 0 (mod 5) => 2*A109306(n)^2 == 0 (mod 50).

Examples

			50 = 2*5^2 is in the sequence because 50^2 + 1 = 41*61 with 50 = (41 + 61)/2 - 1.
		

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=250:printf(`%d, `,8):
    for k from 0 to nn do:
    n:=50*k^2:d:=factorset(n^2+1):
      if bigomega(n^2+1)=2 and (d[1]+d[2])/2 - 1 = n
       then
        printf(`%d, `,n):
        else
      fi:
    od:
  • Mathematica
    q[n_] := Module[{f = FactorInteger[n^2 + 1]}, f[[;; , 2]] == {1, 1} && f[[1, 1]] + f[[2, 1]] == 2*n + 2]; Select[Range[3*10^5], q] (* Amiram Eldar, Jan 26 2022 *)
  • PARI
    isok(m) = my(x); if (bigomega(x=m^2+1)==2, my(f=factor(x)); (f[1,1]+f[2,1] == 2*(m+1))); \\ Michel Marcus, Jan 26 2022
Showing 1-3 of 3 results.