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

A353088 Primes having square prime gaps to both neighbor primes.

Original entry on oeis.org

9551, 12889, 22193, 22307, 27143, 29917, 32261, 40423, 42863, 46807, 46993, 47981, 57637, 60041, 60493, 71597, 72613, 73819, 77137, 84263, 88427, 89153, 90583, 93463, 97463, 97613, 97883, 112543, 115057, 118931, 126307, 127877, 131321, 134093, 137873, 144883
Offset: 1

Views

Author

Alois P. Heinz, Apr 22 2022

Keywords

Examples

			Prime 9551 is a term, the gap to the previous prime 9547 is 4 and the gap to the next prime 9587 is 36 and both gaps are squares.
		

Crossrefs

Programs

  • Maple
    q:= n-> isprime(n) and andmap(issqr, [n-prevprime(n), nextprime(n)-n]):
    select(q, [$3..200000])[];
  • Mathematica
    q[n_] := PrimeQ[n] && IntegerQ@Sqrt[n-NextPrime[n, -1]] && IntegerQ@ Sqrt[NextPrime[n]-n];
    Select[Range[3, 200000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)
    Select[Prime[Range[2,15000]],AllTrue[{Sqrt[#-NextPrime[#,-1]],Sqrt[NextPrime[#]-#]},IntegerQ]&] (* Harvey P. Dale, Jan 22 2024 *)
  • Python
    from itertools import islice
    from sympy import nextprime, integer_nthroot
    def A353088_gen(): # generator of terms
        p, q, g, h = 3, 5, True, False
        while True:
            if g and h:
                yield p
            p, q = q, nextprime(q)
            g, h = h, integer_nthroot(q-p,2)[1]
    A353088_list = list(islice(A353088_gen(),30)) # Chai Wah Wu, Apr 22 2022

A353135 Primes having Fibonacci prime gaps to both neighbor primes.

Original entry on oeis.org

3, 5, 10007, 11777, 12163, 17291, 20443, 20477, 37781, 41333, 47743, 47777, 49991, 59887, 59921, 61091, 61331, 64271, 77417, 88177, 88609, 88643, 89363, 91639, 93337, 97073, 105863, 106453, 107507, 108463, 108497, 112363, 113383, 113717, 125149, 133631, 134293
Offset: 1

Views

Author

Alois P. Heinz, Apr 25 2022

Keywords

Examples

			Prime 10007 is a term, the gap to the previous prime 9973 is 34 and the gap to the next prime 10009 is 2 and both gaps are Fibonacci numbers.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember; (t-> issqr(t+4) or issqr(t-4))(5*n^2) end:
    q:= n-> isprime(n) and andmap(f, [n-prevprime(n), nextprime(n)-n]):
    select(q, [$3..150000])[];
  • Mathematica
    f[n_] := f[n] = With[{t = 5n^2}, IntegerQ@Sqrt[t+4] || IntegerQ@Sqrt[t-4]];
    q[n_] := PrimeQ[n] && f[n-NextPrime[n, -1]] && f[NextPrime[n]-n];
    Select[Range[3, 150000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)

A353137 Primes whose gaps to both neighbor primes are powers of two.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 41, 43, 71, 97, 101, 103, 107, 109, 193, 197, 227, 229, 281, 311, 313, 349, 397, 401, 457, 461, 463, 487, 491, 499, 617, 643, 743, 761, 769, 823, 827, 857, 859, 881, 883, 911, 937, 1091, 1093, 1279, 1301, 1303, 1427, 1429, 1447, 1451
Offset: 1

Views

Author

Alois P. Heinz, Apr 25 2022

Keywords

Examples

			Prime 1447 is a term, the gap to the previous prime 1439 is 8 and the gap to the next prime 1451 is 4 and both gaps are powers of two.
		

Crossrefs

Programs

  • Maple
    p2:= proc(n) option remember; is(n=2^ilog2(n)) end:
    q:= n-> isprime(n) and andmap(p2, [n-prevprime(n), nextprime(n)-n]):
    select(q, [$3..3000])[];
  • Mathematica
    p2[n_] := n == 2^Floor[Log2[n]];
    q[n_] := PrimeQ[n] && p2[n-NextPrime[n, -1]] && p2[NextPrime[n]-n];
    Select[Range[3, 3000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)

A353550 Primes having cube prime gaps to both neighbor primes.

Original entry on oeis.org

89689, 107441, 367957, 368021, 725209, 803749, 832583, 919511, 1070753, 1315151, 1333027, 1353487, 1414913, 1843357, 2001911, 2038039, 2201273, 2207783, 2269537, 2356699, 2356763, 2670817, 2696843, 2715071, 2717929, 2731493, 2906887, 2971841, 3032467, 3184177, 3252217
Offset: 1

Views

Author

Karl-Heinz Hofmann, Apr 25 2022

Keywords

Comments

Up to prime 669763117 all gaps are 8 and 64 or 64 and 8. Prime 669763117 is the first one with gaps 8 and 216. Possible gaps must be in A016743.

Examples

			a(2) = 107441; previous prime is 107377 and the gap is 64 (a cube); next prime is 107449 and the gap is 8 (a cube too).
		

Crossrefs

Cf. A000040, A000578, A016743, A353088 (square gaps), A163112 (gaps > 20).
Cf. A353137 (gaps are a power of 2), A353135 (Fibonacci gaps).
Cf. A353136 (triangular numbers gaps).

Programs

Showing 1-4 of 4 results.