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.

User: Ryan Bresler

Ryan Bresler's wiki page.

Ryan Bresler has authored 6 sequences.

A352002 a(n) = prime(n)# + prime(n), where prime(n)# is the n-th primorial number A002110(n).

Original entry on oeis.org

4, 9, 35, 217, 2321, 30043, 510527, 9699709, 223092893, 6469693259, 200560490161, 7420738134847, 304250263527251, 13082761331670073, 614889782588491457, 32589158477190044783, 1922760350154212639129, 117288381359406970983331, 7858321551080267055879157, 557940830126698960967415461
Offset: 1

Author

Ryan Bresler, Feb 27 2022

Keywords

Examples

			a(3) = prime(3)# + prime(3) = 2 * 3 * 5 + 5 = 35.
		

Crossrefs

Programs

  • PARI
    a(n) = prime(n) + prod(k=1, n, prime(k)); \\ Michel Marcus, Feb 28 2022
    
  • Python
    from sympy import primorial, prime
    def a(n): return primorial(n) + prime(n)
    for n in range(1,50):
        print(a(n), end=", ") # Javier Rivera Romeu, Mar 01 2022

Formula

a(n) = A002110(n) + A000040(n). Also a(n) = prime(n) * (prime(n-1)# + 1).

A350496 Positive integers k such that if p is the largest prime less than k then k - p is prime.

Original entry on oeis.org

5, 7, 9, 10, 13, 15, 16, 19, 21, 22, 25, 26, 28, 31, 33, 34, 36, 39, 40, 43, 45, 46, 49, 50, 52, 55, 56, 58, 61, 63, 64, 66, 69, 70, 73, 75, 76, 78, 81, 82, 85, 86, 88, 91, 92, 94, 96, 99, 100, 103, 105, 106, 109, 111, 112, 115, 116, 118, 120, 124, 126, 129
Offset: 1

Author

Ryan Bresler, Jan 01 2022

Keywords

Comments

a(n) is prime only when n is the greater of a twin prime pair (A006512). All other terms are composite.

Examples

			9 is a term because the previous prime < 9 is 7, and 9 - 7 = 2, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2, 130], PrimeQ[# - NextPrime[#, -1]] &] (* Amiram Eldar, Jan 02 2022 *)
  • PARI
    isok(k) = if (k>2, my(q=precprime(k-1)); isprime(k-q)); \\ Michel Marcus, Jan 02 2022
  • Python
    from sympy import isprime, prevprime
    def ok(n): return n > 2 and isprime(n-prevprime(n))
    print([k for k in range(249) if ok(k)]) # Michael S. Branicky, Jan 01 2022
    

A350460 Positive integers k such that if p is the next prime > k then p - k is prime.

Original entry on oeis.org

3, 5, 8, 9, 11, 14, 15, 17, 20, 21, 24, 26, 27, 29, 32, 34, 35, 38, 39, 41, 44, 45, 48, 50, 51, 54, 56, 57, 59, 62, 64, 65, 68, 69, 71, 74, 76, 77, 80, 81, 84, 86, 87, 90, 92, 94, 95, 98, 99, 101, 104, 105, 107, 110, 111, 114, 116, 120, 122, 124, 125, 128, 129
Offset: 1

Author

Ryan Bresler, Jan 01 2022

Keywords

Comments

a(n) is only prime when n is the lesser of a twin prime pair (A001359). All other terms are composite.

Examples

			3 is a term because the next prime > 3 is 5, and 5 - 3 = 2, which is prime.
14 is a term because the next prime > 14 is 17, and 17 - 14 = 3, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[130], PrimeQ[NextPrime[#] - #] &] (* Amiram Eldar, Jan 01 2022 *)
  • PARI
    isok(k) = my(p=nextprime(k+1)); isprime(p-k); \\ Michel Marcus, Jan 01 2022
  • Python
    from sympy import isprime, nextprime
    def ok(n): return n > 0 and isprime(nextprime(n) - n)
    print([k for k in range(130) if ok(k)]) # Michael S. Branicky, Jan 01 2022
    

A350472 Positive integers k such that if p is the next prime > k, and q is the previous prime < k, then p - k is prime and k - q is prime.

Original entry on oeis.org

5, 9, 15, 21, 26, 34, 39, 45, 50, 56, 64, 69, 76, 81, 86, 92, 94, 99, 105, 111, 116, 120, 124, 129, 134, 142, 144, 146, 154, 160, 165, 170, 176, 184, 186, 188, 195, 204, 206, 216, 218, 225, 231, 236, 244, 246, 248, 254, 260, 266, 274, 279, 286, 288, 290, 296
Offset: 1

Author

Ryan Bresler, Jan 01 2022

Keywords

Comments

a(n) can only be composite (excluding a(1) = 5).

Examples

			9 is a term because the next prime > 9 is 11 and the previous prime < 9 is 7, and 11 - 9 = 2 (which is prime) and 9 - 7 = 2 (which is also prime).
		

Crossrefs

Intersection of A350496 and A350460.

Programs

  • Maple
    q:= n-> andmap(isprime, [nextprime(n)-n, n-prevprime(n)]):
    select(q, [$3..400])[];  # Alois P. Heinz, Jan 01 2022
  • Mathematica
    Select[Range[350], And @@ PrimeQ[{# - NextPrime[#, -1], NextPrime[#] - #}] &] (* Amiram Eldar, Jan 01 2022 *)
  • PARI
    isok(k) = my(p=nextprime(k+1), q=precprime(k-1)); isprime(p-k) && isprime(k-q); \\ Michel Marcus, Jan 01 2022
  • Python
    from sympy import isprime, nextprime, prevprime
    def ok(n):
        return n > 2 and isprime(nextprime(n) - n) and isprime(n - prevprime(n))
    print([k for k in range(341) if ok(k)]) # Michael S. Branicky, Jan 01 2022
    

A344825 Integers whose digit sum is prime and whose digit product is a perfect square > 0.

Original entry on oeis.org

11, 14, 41, 49, 94, 111, 119, 122, 128, 133, 155, 166, 182, 188, 191, 199, 212, 218, 221, 229, 236, 263, 281, 289, 292, 298, 313, 326, 331, 362, 368, 386, 449, 494, 515, 551, 559, 595, 616, 623, 632, 638, 661, 683, 779, 797, 812, 818, 821, 829, 836, 863, 881
Offset: 1

Author

Ryan Bresler, May 29 2021

Keywords

Comments

If k is in the sequence then all anagrams of k are in the sequence. - David A. Corneth, May 29 2021
Trivially, this sequence has infinite elements. A031974 is an infinite sequence that is found in this sequence - Ryan Bresler, May 30 2021

Examples

			11 is a term because its digit sum is 2 (prime) and its digit product is 1 (perfect square > 0).
		

Crossrefs

Intersection of A028834 and A050626.
Subsequence of A052382.
A031974 is a subsequence of this sequence.

Programs

  • Maple
    q:= n-> (l-> not 0 in l and isprime(add(i, i=l)) and
             issqr(mul(i, i=l)))(convert(n, base, 10)):
    select(q, [$0..999])[];  # Alois P. Heinz, May 29 2021
  • Python
    from math import prod
    from sympy import isprime, integer_nthroot
    def ok(n):
      d = list(map(int, str(n)))
      return 0 not in d and isprime(sum(d)) and integer_nthroot(prod(d), 2)[1]
    print(list(filter(ok, range(1000)))) # Michael S. Branicky, May 29 2021

A341269 Number of non-extendable self-avoiding walks in an n X n grid starting at the top left corner.

Original entry on oeis.org

1, 2, 20, 548, 40440, 8442742, 5088482972, 8963926817126, 46591697187961736
Offset: 1

Author

Ryan Bresler, Feb 07 2021

Keywords

Comments

A self-avoiding walk is non-extendable if it ends on a square which has all its neighbors already visited. Not all paths are Hamiltonian. See examples.
All paths that start by moving one square to the right are symmetrical with all paths that start by moving one square down. This symmetry results in a(n) divisible by 2 for n > 1.

Examples

			Example of a self-avoiding walk on a 3 X 3 grid that visits every node (Hamiltonian path):
.
  1---2---3
          |
  6---5---4
  |
  7---8---9
.
Two examples of a self-avoiding walk on a 3 X 3 grid that do not visit every node:
.
  1---2   7
      |   |
  X   3   6
      |   |
  X   4---5
.
or
.
  1   8---7
  |       |
  2---3   6
      |   |
  X   4---5
.
		

Crossrefs

Cf. A145157 (Hamiltonian case).

Extensions

a(8)-a(9) from Andrew Howroyd, Feb 08 2021
a(6) corrected by Henry Bottomley, Oct 07 2021