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

A196274 Half of the gaps A067970 between odd nonprimes A014076.

Original entry on oeis.org

4, 3, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 1, 3, 1, 2, 3, 1, 2, 2, 1, 2, 1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 3, 1, 2, 1, 2, 2, 1, 2, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 2, 1, 3, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 3, 1, 1, 1, 2
Offset: 1

Views

Author

M. F. Hasler, Sep 30 2011

Keywords

Comments

a(n) < 4 for n > 1; a(A196276(n)) = 1; a(A196277(n)) > 1. - Reinhard Zumkeller, Sep 30 2011
Lengths of runs of equal terms in A025549. That sequence begins with: 1,1,1,1,3,3,3,45,45,45,..., that is 4 ones, 3 threes, 3 forty-fives, ... - Michel Marcus, Dec 02 2014

Examples

			The smallest odd numbers which are not prime are 1, 9, 15, 21, 25, 27,... (sequence A014076).
The gaps between these are: 8, 6, 6, 4, 2,... (sequence A067970), which are of course all even by construction, so it makes sense to divide all of them by 2, which yields this sequence: 4, 3, 3, 2, 1, ...
		

Crossrefs

Cf. A142723 for the decimal value of the associated continued fraction.

Programs

  • Mathematica
    With[{nn=401},Differences[Complement[Range[1,nn,2],Prime[Range[ PrimePi[ nn]]]]]/2] (* Harvey P. Dale, May 06 2012 *)
  • PARI
    L=1;forstep(n=3,299,2,isprime(n)&next;print1((n-L)/2",");L=n)
    
  • Python
    from sympy import primepi, isprime
    def A196274(n):
        if n == 1: return 4
        m, k = n-1, primepi(n) + n - 1 + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n - 1 + (k>>1)
        for d in range(1,4):
            if not isprime(m+(d<<1)):
                return d # Chai Wah Wu, Jul 31 2024

Formula

a(n) = (A014076(n+1)-A014076(n))/2 = A067970(n)/2.

Extensions

More terms from Harvey P. Dale, May 06 2012

A144411 Odd nonprime gaps adjusted to be {2,1,0,-1}: a(n)=A067970(n)/2-2.

Original entry on oeis.org

2, 1, 1, 0, -1, 1, -1, 0, 1, 0, -1, 0, -1, 1, -1, 0, 1, -1, 0, 0, -1, 0, -1, -1, 0, 1, 1, 0, -1, -1, -1, -1, -1, 0, 0, -1, 1, -1, -1, -1, 1, -1, 0, -1, 0, 0, -1, 0, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, 1, 0, -1, 1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, 1, -1, -1, -1, 0, -1, -1, -1, -1, -1, 0, 1, 0, -1, -1, -1, -1, -1, 0
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 30 2008

Keywords

Programs

  • Mathematica
    b = Flatten[Table[If[PrimeQ[2*n + 1], {}, 2*n + 1], {n, 0, 200}]]; c = Table[(b[[n + 1]] - b[[n]])/2 - 2, {n, 1, Length[b] - 1}]

Formula

a(n)=A067970(n)/2-2.

A144412 Invert transform of odd nonprime gaps adjusted to be from the set {2,1,0,-1}: b(n)=A067970(n)/2-2; a(n)=Sum[b(n + 1)*a(n - k), {k, 1, n}].

Original entry on oeis.org

2, 2, 4, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 30 2008

Keywords

Comments

Except for the first five elements, the inverse transform result seems to be zero.

Crossrefs

Programs

  • Mathematica
    b = Flatten[Table[If[PrimeQ[2*n + 1], {}, 2*n + 1], {n, 0, 200}]]; c = Table[(b[[n + 1]] - b[[n]])/2 - 2, {n, 1, Length[b] - 1}]; a[0] = c[[1]]; a[n_] := a[n] = Sum[c[[n + 1]]*a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 100}]

Formula

b(n)=A067970(n)/2-2; a(n)=Sum[b(n + 1)*a(n - k), {k, 1, n}].

A014076 Odd nonprimes.

Original entry on oeis.org

1, 9, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, 55, 57, 63, 65, 69, 75, 77, 81, 85, 87, 91, 93, 95, 99, 105, 111, 115, 117, 119, 121, 123, 125, 129, 133, 135, 141, 143, 145, 147, 153, 155, 159, 161, 165, 169, 171, 175, 177, 183, 185, 187, 189, 195, 201, 203, 205, 207
Offset: 1

Views

Author

Keywords

Comments

Same as A071904 except for the initial term 1 (which is not composite).
Numbers n such that product of first n odd numbers divided by sum of the first n odd numbers is an integer : 1*3*5*...*(2*n - 1) / (1 + 3 + 5 + ... + (2*n - 1)) = c. - Ctibor O. Zizka, Jun 26 2010
Conjecture: There exist infinitely many pairs [a(n), a(n)+6] such that a(n)/3 and (a(n)+6)/3 are twin primes. - Eric Desbiaux, Sep 25 2014.
Odd numbers 2*n + 1 such that (2*n)!/(2*n + 1) is an integer. Odd terms of A056653. - Peter Bala, Jan 24 2017

Crossrefs

Cf. A002808, A005408; first differences: A067970, A196274; A047846.
Cf. A056653.

Programs

  • Haskell
    a014076 n = a014076_list !! (n-1)
    a014076_list = filter ((== 0) . a010051) a005408_list
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Maple
    remove(isprime, [seq(i,i=1..1000,2)]); # Robert Israel, May 25 2016
    for n from 0 to 120 do
    if irem(factorial(2*n), 2*n+1) = 0 then print(2*n+1) end if;
    end do: # Peter Bala, Jan 24 2017
  • Mathematica
    Select[Range@210, !PrimeQ@ # && OddQ@ # &] (* Robert G. Wilson v, Sep 22 2008 *)
    Select[Range[1, 199, 2], PrimeOmega[#] != 1 &] (* Alonso del Arte, Nov 19 2012 *)
  • PARI
    is(n)=n%2 && !isprime(n) \\ Charles R Greathouse IV, Nov 24 2012
    
  • Python
    from sympy import primepi
    def A014076(n):
        if n == 1: return 1
        m, k = n-1, primepi(n) + n - 1 + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n - 1 + (k>>1)
        return m # Chai Wah Wu, Jul 31 2024

Formula

A000035(a(n))*(1 - A010051(a(n))) = 1. - Reinhard Zumkeller, Sep 30 2011
a(n) ~ 2n. - Charles R Greathouse IV, Jul 02 2013
(a(n+2)-1)/2 - pi(a(n+2)-1) = n. - Anthony Browne, May 25 2016. Proof from Robert Israel: This follows by induction on n. If f(n) = (a(n+2)-1)/2 - pi(a(n+2)-1), one can show f(n+1) - f(n) = 1 (there are three cases to consider, depending on primeness of a(n+2) + 2 and a(n+2) + 4).
Union of A091113 and A091236. - R. J. Mathar, Oct 02 2018

A373403 Length of the n-th maximal antirun of composite numbers differing by more than one.

Original entry on oeis.org

3, 1, 3, 1, 3, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

This antirun ranges from A005381 (with 4 prepended) to A068780, with sum A373404.
An antirun of a sequence (in this case A002808) is an interval of positions such that consecutive terms differ by more than one.

Examples

			Row-lengths of:
   4   6   8
   9
  10  12  14
  15
  16  18  20
  21
  22  24
  25
  26
  27
  28  30  32
  33
  34
  35
  36  38
  39
  40  42  44
		

Crossrefs

Functional neighbors: A005381, A027833 (partial sums A029707), A068780, A176246 (rest of A046933, firsts A073051), A373127, A373404, A373409.
A000040 lists the primes, differences A001223.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    Length/@Split[Select[Range[100],CompositeQ],#1+1!=#2&]//Most

Formula

a(2n) = 1.
a(2n - 1) = A196274(n) for n > 1.

A164510 First differences of A071904 (Odd composite numbers).

Original entry on oeis.org

6, 6, 4, 2, 6, 2, 4, 6, 4, 2, 4, 2, 6, 2, 4, 6, 2, 4, 4, 2, 4, 2, 2, 4, 6, 6, 4, 2, 2, 2, 2, 2, 4, 4, 2, 6, 2, 2, 2, 6, 2, 4, 2, 4, 4, 2, 4, 2, 6, 2, 2, 2, 6, 6, 2, 2, 2, 2, 4, 2, 2, 2, 2, 4, 6, 4, 2, 6, 2, 2, 2, 4, 2, 4, 2, 4, 2, 6, 2, 4, 6, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 6, 4, 2, 2, 2, 2, 2, 4, 2, 4, 2, 2, 2, 6
Offset: 1

Views

Author

Zak Seidov, Aug 14 2009

Keywords

Comments

Are all terms <=6?
This is A067970 without its first term. [R. J. Mathar, Aug 17 2009]
Yes, all terms are at most 6. For a value of 8, we have to have p, p+2, p+4 all prime, and this is possible only for p=3. As a result, 1 would have to be an odd composite number, which it is not. Therefore all terms are <=6. [J. Lowell, Aug 17 2009]

Crossrefs

Cf. A071904.

Programs

  • Mathematica
    Differences@ Select[Range[1, 360, 2], CompositeQ] (* Michael De Vlieger, Aug 29 2025 *)
  • Python
    from sympy import primepi, isprime
    def A164510(n):
        m, k = n, primepi(n+1) + n + (n+1>>1)
        while m != k:
            m, k = k, primepi(k) + n + (k>>1)
        for d in range(2, 7, 2):
            if not isprime(m+d):
                return d # Chai Wah Wu, Aug 02 2024

A257233 Multiplicity sequence for the alternating row sums of triangle A257232.

Original entry on oeis.org

1, 7, 6, 6, 4, 2, 6, 2, 4, 6, 4, 2, 4, 2, 6, 2, 4, 6, 2, 4, 4, 2, 4, 2, 2, 4, 6, 6, 4, 2, 2, 2, 2, 2, 4, 4, 2, 6, 2, 2, 2, 6, 2, 4, 2, 4, 4, 2, 4, 2, 6, 2, 2, 2, 6, 6, 2, 2, 2, 2, 4, 2, 2, 2, 2, 4
Offset: 1

Views

Author

Wolfdieter Lang, Apr 19 2015

Keywords

Comments

The sequence of alternating row sums of A257232 gives one times 1, seven times 2, 6 times 3, six times 4, four times 5, etc., in this order.
Is a(n) = A067970(n-1), n>=3 ? - R. J. Mathar, Apr 24 2015

Crossrefs

Cf. A257232.

Formula

The number m appears a(m) times in the sequence of row sums of triangle A257232 for m = 1, 2, ..., that is in sum(((-1)^(k-1))*(n - (k-1) - [isprime(k)]), k = 1..n) with [isprime(k)] = A010051(k) for n >= 1.
Showing 1-7 of 7 results.