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

A226069 Primes p such that p-1 is a square and p-2 is a triangular number.

Original entry on oeis.org

2, 5, 17, 17957, 4726277, 23911673957
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

Roots of squares: a(n)-1 = b(n)*b(n), b(n) = A226070(n).
Roots of triangular numbers: a(n)-2 = c(n)*(c(n)+1)/2, c(n) = A226071(n).
Primes of the form A006452(k)^2+1. a(7) is too large to include here (see b-file). - Max Alekseyev, Jan 30 2014

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<34)
    int main() {
      unsigned long long i, j, k, r, n=1;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP*2; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          ++n;
          if (i<(1ULL<<32))
            for (j=i*i>>1; j>3] |= 1 << (j&7);
        }
      //printf("%llu\n", n);
      for (i=1, j=i*i+1; j < TOP*2; i++,j=i*i+1)
        if(j==2 || ((j&1) && (c[j>>4] & (1<<((j>>1) & 7)))==0)) {
          k = j-2;
          r = sqrt(k*2);
          if (r*r+r==k*2) printf("%9llu %9llu %9llu\n", r, i, j);
        }
      free(c);
      return 0;
    }

Extensions

Terms a(7)-a(12) from Max Alekseyev, Jan 30 2014

A226072 Primes p such that p-1 is a triangular number and p-2 is a square.

Original entry on oeis.org

2, 11, 11027, 16944049179227, 94511138700672573788068264540372768937231403134027
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

Intersection of A129545 and A164055.
a(6) has 106 decimal digits: 12450353555...7512227.
a(7) has 381 decimal digits: 49394105798...1431227.
Roots of corresponding squares and triangular numbers: A226074 and A226073.

Crossrefs

Programs

  • Java
    import java.io.*;
    import java.math.BigInteger;
    public class A226072 {
    public static void main (String[] args) throws Exception {
      try {
        BufferedReader in = new BufferedReader(
          new FileReader(new File("b164055.txt")));
        String line;
        while ((line = in.readLine()) != null) {
          BigInteger b = new BigInteger(line.split(" ")[1]);
          b = b.add(BigInteger.ONE);
          if (b.isProbablePrime(80))
            System.out.printf("%s, ", b.toString());
        }
      } catch (Exception e) {  e.printStackTrace();  }
    }
    }
  • Mathematica
    Select[Prime[Range[1500]],OddQ[Sqrt[8(#-1)+1]]&&IntegerQ[Sqrt[#-2]]&] (* The program generates the first 3 terms of the sequence. *) (* Harvey P. Dale, Jul 20 2024 *)

A226070 Numbers k such that k^2-1 is a triangular number and k^2+1 is a prime.

Original entry on oeis.org

1, 2, 4, 134, 2174, 154634
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

Subsequence of A006452 that consists of the terms k such that k^2+1 is prime.
a(7) is too large to include here (see b-file). - Max Alekseyev, Jan 30 2014

Crossrefs

Corresponding primes: A226069.
Indices of corresponding triangular numbers: A226071.

Programs

  • C
    // see A226069.
  • Mathematica
    Select[Range[155000],PrimeQ[#^2+1]&&OddQ[Sqrt[8(#^2-1)+1]]&] (* Harvey P. Dale, Jul 19 2019 *)

Extensions

Terms a(7)-a(12) from Max Alekseyev, Jan 30 2014

A226071 Numbers k such that triangular(k)+1 is a square and triangular(k)+2 is a prime.

Original entry on oeis.org

0, 2, 5, 189, 3074, 218685
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

Subsequence of A006451 that contains the terms k such that triangular(k)+2 is prime.
a(7) is too large to include here (see b-file). - Max Alekseyev, Jan 30 2014

Crossrefs

Corresponding primes: A226069.
Roots of corresponding squares: A226070.

Programs

  • C
    // see A226069.
  • Mathematica
    Select[Range[0,220000],IntegerQ[Sqrt[(#(#+1))/2+1]]&&PrimeQ[(#(#+1))/2+2]&] (* Harvey P. Dale, Mar 01 2023 *)

Extensions

Terms a(7)-a(12) from Max Alekseyev, Jan 30 2014

A226073 Numbers k such that triangular(k)-1 is a square and triangular(k)+1 is a prime number.

Original entry on oeis.org

1, 4, 148, 5821348, 13748537282247342677718148, 49900608324196518198677680899235165296598423281799348
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

a(7) has 191 decimal digits: 314305920...194453348.
Corresponding primes and roots of squares: A226072 and A226074.

Crossrefs

Showing 1-5 of 5 results.