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.

Previous Showing 11-14 of 14 results.

A161996 A (negated) characteristic function of twin composite odd numbers.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1
Offset: 1

Views

Author

Pierre CAMI, Jun 24 2009

Keywords

Comments

a(n) = 0 if n is a member of A060461, otherwise a(n) = 1.

Crossrefs

Programs

  • Mathematica
    If[AllTrue[6#+{1,-1},CompositeQ],0,1]&/@Range[300] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 15 2015 *)
  • PARI
    A161996(n) = (isprime((6*n)-1)||isprime((6*n)+1)); \\ Antti Karttunen, Dec 15 2017

Extensions

Definition rephrased by R. J. Mathar, Aug 14 2009

A345124 a(n) is the smallest k such that f(k) is composite for all m-fold compositions f of the functions 6*x +- 1, 1 <= m <= n.

Original entry on oeis.org

20, 50, 284, 1868, 47951, 6245927, 15932178151
Offset: 1

Views

Author

Marc Morgenegg, Oct 06 2021

Keywords

Comments

Proof that a(n) exists for all n: The numbers that are equal to f(k) for some m-fold composition f of the functions 6*x +- 1 can be written as 6^m*k +- c, where c is in the set C_m, defined by C_1 = {1} and C_{m+1} = {6*c +- 1 for c in C_m}. Choose a positive integer k_0 that is divisible by all numbers in C_m for 1 <= m <= n. Then 6^m*k_0 +- c is divisible by (and greater than) c, so it is composite if c > 1. (In fact, the largest number in C_m is A003464(m).) Since there are arbitrarily long prime gaps, we can choose a positive integer r such that 6*k_0*r +- 1 are both composite. With k = k_0*r, the numbers 6^m*k +- c will all be composite for c in C_m, 1 <= m <= n, as desired. - Pontus von Brömssen, Nov 01 2021

Examples

			Formula for the twin composites by iteration n:
n=1: 6*k+-1.
n=2: 6*(6*k+-1)+-1.
n=3: 6*(6*(6*k+-1)+-1)+-1.
Term a(n) example for smallest number k for iteration n:
a(1)=20, 6*20-1=119, 6*20+1=121, all {119,121} are composite numbers.
a(2)=50, 6*50-1=299, 6*50+1=301, 6*(6*50-1)-1=1793, 6*(6*50-1)+1=1795, 6*(6*50+1)-1=1805, 6*(6*50+1)+1=1807, all {299,301,1793,1795,1805,1807} are composite numbers.
		

Crossrefs

Cf. A003464, A060461 (numbers k such that 6*k+-1 are twin composites).

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[!AllTrue[Flatten@ Rest@ NestList[Flatten@ Join[{6*# - 1, 6*# + 1}] &, k, n], CompositeQ], k++]; k]; Array[a, 5] (* Amiram Eldar, Oct 25 2021 *)
  • Python
    from sympy import isprime
    def A345124(n):
        C = [[1]]
        for i in range(n-1):
            C.append(sum(([6*c-1,6*c+1] for c in C[-1]),[]))
        k = 1
        while 1:
            k6 = 6*k
            for i in range(n):
                if any(isprime(k6-c) or isprime(k6+c) for c in C[i]):
                    break
                k6 *= 6
            else:
                return k
            k += 1 # Pontus von Brömssen, Nov 01 2021

Extensions

More terms from Pontus von Brömssen, Oct 06 2021
Name edited by Pontus von Brömssen, Nov 01 2021
a(7) from Martin Ehrenstein, Nov 13 2021

A217707 Numbers n such that both 4*n-1 and 4*n+1 are composite.

Original entry on oeis.org

14, 16, 19, 23, 29, 30, 31, 36, 40, 44, 46, 47, 51, 52, 54, 55, 59, 61, 62, 65, 72, 74, 75, 76, 80, 81, 82, 85, 86, 89, 91, 94, 98, 101, 103, 104, 106, 107, 109, 113, 118, 119, 121, 124, 128, 129, 132, 133, 134, 136, 138, 140, 145, 146, 149, 151, 156, 157, 159
Offset: 1

Views

Author

Jayanta Basu, Mar 20 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[200], ! PrimeQ[4 # - 1] && ! PrimeQ[4 # + 1] &]
    Select[Range[200],AllTrue[4#+{1,-1},CompositeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 11 2015 *)

A377540 Numbers k such that at least one of the numbers 6k-1 or 6k+1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 32, 33, 35, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 49, 51, 52, 53, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 87
Offset: 1

Views

Author

Keywords

Crossrefs

Union of A024898 and A024899.
Complement of A060461 (with respect to the positive integers) or A171696 (with respect to the nonnegative integers).

Programs

  • Mathematica
    Select[Range[100], PrimeQ[6 # - 1] || PrimeQ[6 # + 1] &]
  • PARI
    isok(k) = isprime(6*k-1) || isprime(6*k+1); \\ Michel Marcus, Oct 31 2024
Previous Showing 11-14 of 14 results.