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

A047846 Number of successive odd nonprimes (A014076).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 3, 1, 1, 1, 6, 1, 2, 4, 2, 2, 1, 2, 2, 4, 1, 5, 5, 1, 1, 2, 4, 2, 2, 2, 2, 1, 4, 6, 1, 1, 6, 2, 4, 1, 2, 3, 2, 2, 1, 2, 3, 1, 3, 4, 4, 2, 1, 2, 3, 1, 1, 5, 3, 1, 3, 1, 2, 5, 8, 2, 4, 2, 2, 2, 4, 2, 2, 2, 2, 1, 5
Offset: 1

Views

Author

Keywords

Comments

Beginning with a(2), length of n-th run of identical numbers in A160522 [Kyle Stern, Jun 19 2009]
a(n+1) = A196277(n+1) - A196277(n). [Reinhard Zumkeller, Sep 30 2011]

Crossrefs

Length of n-th run in A014076.
Cf. A160522.

Programs

  • Haskell
    a047846 n = a047846_list !! (n-1)
    a047846_list = 1 : zipWith (-) (tail a196277_list) a196277_list
    -- Reinhard Zumkeller, Sep 30 2011
  • Mathematica
    Length /@ Split[Select[Range[1, 629, 2], PrimeOmega[#] != 1 &], #2 - #1 <= 2 &] (* Jayanta Basu, Aug 11 2013 *)
    Length/@Select[Split[Table[If[PrimeQ[n],0,1],{n,1,701,2}]],#[[1]]==1&] (* Harvey P. Dale, Oct 10 2023 *)

Extensions

a(51) and a(84) corrected by Reinhard Zumkeller, Sep 30 2011

A165971 The n-th odd nonprime minus the n-th even nonprime.

Original entry on oeis.org

1, 5, 9, 13, 15, 15, 19, 19, 21, 25, 27, 27, 29, 29, 33, 33, 35, 39, 39, 41, 43, 43, 45, 45, 45, 47, 51, 55, 57, 57, 57, 57, 57, 57, 59, 61, 61, 65, 65, 65, 65, 69, 69, 71, 71, 73, 75, 75, 77, 77, 81, 81, 81, 81, 85, 89, 89, 89, 89, 89, 91, 91, 91, 91, 91, 93, 97, 99, 99, 103
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 02 2009

Keywords

Examples

			a(1) = 1-0 = 1. a(2) = 9-4 = 5. a(3) = 15-6 = 9.
		

Crossrefs

Programs

  • Mathematica
    A014076 := Select[Range@500, ! PrimeQ@# && OddQ@# &]; A163300 := Drop[Range[0, 500, 2], {2}]; Table[(-A163300[[n]] + A014076[[n]]), {n, 1, 50}] (* G. C. Greubel, Sep 17 2017 *)
  • Python
    from sympy import primepi
    def A165971(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-(n<<1) # Chai Wah Wu, Aug 01 2024

Formula

a(n) = A014076(n) - A163300(n).
Equals: {1} U A160522.

Extensions

77 duplicated by R. J. Mathar, Oct 10 2009
Showing 1-2 of 2 results.