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

A037073 Numbers k such that (6*k)^2 is the sum of a twin prime pair.

Original entry on oeis.org

1, 2, 7, 8, 12, 14, 15, 29, 34, 44, 51, 62, 68, 76, 79, 91, 99, 100, 107, 125, 142, 147, 156, 162, 163, 173, 190, 202, 212, 231, 245, 252, 253, 264, 295, 306, 317, 330, 331, 355, 366, 376, 377, 386, 397, 442, 448, 453, 462, 469, 481, 491, 498, 502, 516, 547
Offset: 1

Views

Author

Keywords

Examples

			E.g. n=44 -> (6*44)^2 = 69696 = 34847 + 34849 (twin prime pair).
		

Crossrefs

Programs

  • Maple
    isa := n -> isprime(n) and isprime(n+2) and issqr(2*n+2):
    select(isa, [$4..1000000]): map(n -> sqrt(2*n+2)/6, %); # Peter Luschny, Jan 05 2020
  • Mathematica
    Select[Sqrt[Plus@@@Select[Partition[Prime[Range[4*10^5]],2,1],Differences[#]=={2} &]/36],IntegerQ] (* Jayanta Basu, May 26 2013 *)
  • PARI
    is(n)=isprime(18*n^2-1)&&isprime(18*n^2+1) \\ M. F. Hasler, Oct 30 2023

Formula

a(n) = A173165(n)/3. - M. F. Hasler, Oct 30 2023

Extensions

More terms from Jud McCranie, Dec 30 2000

A226461 Numbers n such that the following are six primes: 2*n^2 +- 1, 3*n^2 +- 1, 5*n^2 +- 1.

Original entry on oeis.org

6, 2100, 20586, 669054, 745590, 6556122, 9317496, 10190796, 15648732, 18215196, 25561410, 35613990, 36710652, 38649066, 41124594, 41711874, 46576524, 48701400, 49406358, 59278296, 70038948, 74993808, 75553092, 83606418, 84182154, 88000374, 92527764, 98969052, 100691976
Offset: 1

Views

Author

Alex Ratushnyak, Jun 08 2013

Keywords

Comments

6 is in the sequence because the following are six primes: 71, 73, 107, 109, 179, 181.

Crossrefs

Cf. A173165.

Programs

  • Java
    import java.math.BigInteger;
    public class A226461 {
        public static void main (String[] args) {
          for (long n = 1; n < (1L << 30); n++) {
              long x = n*n*5;
              BigInteger b = BigInteger.valueOf(x+1);
              if (!b.isProbablePrime(80)) continue;
              b = BigInteger.valueOf(x-1);
              if (!b.isProbablePrime(80)) continue;
              x = n*n*2;
              b = BigInteger.valueOf(x+1);
              if (!b.isProbablePrime(80)) continue;
              b = BigInteger.valueOf(x-1);
              if (!b.isProbablePrime(80)) continue;
              x = n*n*3;
              b = BigInteger.valueOf(x+1);
              if (!b.isProbablePrime(80)) continue;
              b = BigInteger.valueOf(x-1);
              if (!b.isProbablePrime(80)) continue;
              System.out.printf("%d, ", n);
          }
        }
    }
  • Mathematica
    spQ[n_]:=AllTrue[Flatten[{2n^2+{1,-1},3n^2+{1,-1},5n^2+{1,-1}}],PrimeQ]; Select[ Range[101*10^6],spQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 28 2015 *)
Showing 1-2 of 2 results.