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-10 of 80 results. Next

A047845 a(n) = (m-1)/2, where m is the n-th odd nonprime (A014076(n)).

Original entry on oeis.org

0, 4, 7, 10, 12, 13, 16, 17, 19, 22, 24, 25, 27, 28, 31, 32, 34, 37, 38, 40, 42, 43, 45, 46, 47, 49, 52, 55, 57, 58, 59, 60, 61, 62, 64, 66, 67, 70, 71, 72, 73, 76, 77, 79, 80, 82, 84, 85, 87, 88, 91, 92, 93, 94, 97, 100, 101, 102, 103, 104, 106, 107, 108, 109, 110, 112, 115
Offset: 1

Views

Author

Keywords

Comments

Also (starting with 2nd term) numbers of the form 2xy+x+y for x and y positive integers. This is also the numbers of sticks needed to construct a two-dimensional rectangular lattice of unit squares. See A090767 for the three-dimensional generalization. - John H. Mason, Feb 02 2004
Note that if k is not in this sequence, then 2*k+1 is prime. - Jose Brox (tautocrona(AT)terra.es), Dec 29 2005
Values of k for which A073610(2k+3)=0; values of k for which A061358(2k+3)=0. - Graeme McRae, Jul 18 2006
This sequence also arises in the following way: take the product of initial odd numbers, i.e., the product (2n+1)!/(n!*2^n) and factor it into prime numbers. The result will be of the form 3^f(3)*5^f(5)*7^f(7)*11^f(11)... . Then f(3)/f(5) = 2, f(3)/f(7) = 3, f(3)/f(11) = 5, ... and this sequence forms (for sufficiently large n, of course) the sequence of natural numbers without 4,7,10,12,..., i.e., these numbers are what is lacking in the present sequence. - Andrzej Staruszkiewicz (uszkiewicz(AT)poczta.onet.pl), Nov 10 2007
Also "flag short numbers", i.e., number of dots that can be arranged in successive rows of K, K+1, K, K+1, K, ..., K+1, K (assuming there is a total of L > 1 rows of size K > 0). Adapting Skip Garibaldi's terms, sequence A053726 would be "flag long numbers" because those patterns begin and end with the long lines. If you convert dots to sticks, you get the lattice that John H. Mason mentioned. - Juhani Heino, Oct 11 2014
Numbers k such that (2*k)!/(2*k + 1) is an integer. - Peter Bala, Jan 24 2017
Except for a(1)=0: numbers of the form k == j (mod 2j+1), j >= 1, k > 2j+1. - Bob Selcoe, Nov 07 2017

Crossrefs

Complement of A005097.

Programs

  • Haskell
    a047845 = (`div` 2) . a014076  -- Reinhard Zumkeller, Jan 02 2013
    
  • Magma
    [(n-1)/2 : n in [1..350] | (n mod 2) eq 1 and not IsPrime(n)]; // G. C. Greubel, Oct 16 2023
    
  • Maple
    for n from 0 to 120 do
        if irem(factorial(2*n), 2*n+1) = 0 then print(n); end if;
    end do:
    # Peter Bala, Jan 24 2017
  • Mathematica
    (Select[Range[1, 231, 2], PrimeOmega[#] != 1 &] - 1)/2 (* Jayanta Basu, Aug 11 2013 *)
  • PARI
    print1(0,", ");
    forcomposite(n=1,250,if(1==n%2,print1((n-1)/2,", "))); \\ Joerg Arndt, Oct 16 2023
    
  • Python
    from sympy import primepi
    def A047845(n):
        if n == 1: return 0
        m, k = n-1, primepi(n) + n - 1 + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n - 1 + (k>>1)
        return m-1>>1 # Chai Wah Wu, Jul 31 2024
  • SageMath
    [(n-1)/2 for n in (1..350) if n%2==1 and not is_prime(n)] # G. C. Greubel, Oct 16 2023
    

Formula

A193773(a(n)) > 1 for n > 1. - Reinhard Zumkeller, Jan 02 2013

Extensions

Name edited by Jon E. Schoenfield, Oct 16 2023

A067970 First differences of A014076, the odd nonprimes.

Original entry on oeis.org

8, 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
Offset: 1

Views

Author

Labos Elemer, Feb 04 2002

Keywords

Comments

In this sequence 8 occurs once, but 2,4,6 may occur several times. No other even number arises. Therefore sequence consists of {8,6,4,2}.
Proof: If x is an odd nonprime, then x+2=next-odd-number is either nonprime[Case1] or it is a prime [Case 2]. In Case 1 the difference is 2. E.g., x=25, x+2=27, the actual difference is d=2.
In Case 2 x+2=p=prime. Distinguish two further subcases. In Case 2a: x+2=p=prime and p+2=x+4=q is also a prime. Then x+2+2+2=x+6 will not be prime because in first difference sequence of prime no d=2 occurs twice except for p+2=3+2=5,5+2=7, i.e., when p is divisible by 3; for 6k+1 and 6k+5 primes it is impossible. Consequently x+6 is not a prime and so the difference between two consecutive odd nonprimes is 6. Example: x=39, x+2=41=smaller twin prime and next odd nonprime x+6=45, d=6
In Case 2b: x+2=p=prime, but x+2+2=x+4 is not a prime, i.e., x+2=p is not a smaller one of a twin-prime pair. Thus x+4 is the next odd nonprime. Thus the difference=4. E.g., x=77, x+2=79, so the next odd nonprime is x+4=81, d=4. No more cases. QED.
Interestingly this sequence picks out the twin primes.
That the first term is special is a reflection of the simple fact that there are no 3 consecutive odd primes except from 3, 5, 7 corresponding to A067970(1) = 8 = 9-1 = (7+2)-(3-2). - Frank Ellermann, Feb 08 2002
There are arbitrarily long runs of 2's, but not of 4's or 6's. - Zak Seidov, Oct 01 2011

Crossrefs

Programs

  • Haskell
    a067970 n = a067970_list !! (n-1)
    a067970_list = zipWith (-) (tail a014076_list) a014076_list
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Mathematica
    a = Select[ Range[300], !PrimeQ[ # ] && !EvenQ[ # ] & ]; Table[ a[[n + 1]] - a[[n]], {n, 1, Length[a] - 1} ]
    With[{nn=401},Differences[Complement[Range[1,nn,2],Prime[Range[PrimePi [nn]]]]]]  (* Harvey P. Dale, Feb 05 2012 *)
  • Python
    from sympy import primepi, isprime
    def A067970(n):
        if n == 1: return 8
        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(2,7,2):
            if not isprime(m+d):
                return d # Chai Wah Wu, Jul 31 2024

Formula

a(n) = A014076(n+1) - A014076(n).
a(n) = 2 * A196274(n); a(A196276(n)) = 2; a(A196277(n)) > 2. - Reinhard Zumkeller, Sep 30 2011

Extensions

Edited by Robert G. Wilson v, Feb 08 2002
Offset changed to 1 by Jason Yuen, Jan 08 2025

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

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

A062532 Odd nonprimes squared, or A014076(n)^2.

Original entry on oeis.org

1, 81, 225, 441, 625, 729, 1089, 1225, 1521, 2025, 2401, 2601, 3025, 3249, 3969, 4225, 4761, 5625, 5929, 6561, 7225, 7569, 8281, 8649, 9025, 9801, 11025, 12321, 13225, 13689, 14161, 14641, 15129, 15625, 16641, 17689, 18225, 19881, 20449
Offset: 1

Views

Author

Jason Earls, Jul 10 2001

Keywords

Crossrefs

Cf. A014076.

Programs

  • Mathematica
    With[{nn=500},Complement[Range[1,nn,2],Prime[Range[PrimePi[nn]]]]^2] (* Harvey P. Dale, Nov 12 2012 *)
  • PARI
    je=[]; forstep(n=1,301,2, if(isprime(n), n+1,je=concat(je,n^2))); je
    
  • PARI
    { n=0; forstep (m=1, 10^9, 2, if(!isprime(m), write("b062532.txt", n++, " ", m^2); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 08 2009
    
  • Python
    from sympy import primepi
    def A062532(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**2 # Chai Wah Wu, Jul 31 2024

A256253 Number of successive odd nonprimes A014076 and number of successive odd primes A065091, interleaved.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Mar 30 2015

Keywords

Comments

See also A256252 and A256262 which contain similar diagrams.

Examples

			Consider an irregular array in which the odd-indexed rows list successive odd nonprimes (A014076) and the even-indexed rows list successive odd primes (A065091), in the sequence of odd numbers (A005408), as shown below:
1;
3, 5, 7;
9;
11, 13;
15;
17; 19;
21,
23;
25, 27;
39, 31;
...
a(n) is the length of the n-th row.
.
Illustration of the first 16 regions of the diagram of the symmetric representation of odd nonprimes (A014076) and of odd primes (A065091):
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   31
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   29
.           | | |_ _ _ _ _ _ _ _ _ _ _  | | |   23
.           | | | |_ _ _ _ _ _ _ _ _  | | | |   19
.           | | | |_ _ _ _ _ _ _ _  | | | | |   17
.           | | | | |_ _ _ _ _ _  | | | | | |   13
.           | | | | |_ _ _ _ _  | | | | | | |   11
.           | | | | | |_ _ _  | | | | | | | |    7
.           | | | | | |_ _  | | | | | | | | |    5
.   A014076 | | | | | |_  | | | | | | | | | |    3
.      1    | | | | | |_|_|_|_| | | | | | | | A065091
.      9    | | | | |_ _ _ _ _|_|_| | | | | |
.     15    | | | |_ _ _ _ _ _ _ _|_|_| | | |
.     21    | | |_ _ _ _ _ _ _ _ _ _ _|_| | |
.     25    | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
.     27    |_ _ _ _ _ _ _ _ _ _ _ _ _ _|_|_|
.
a(n) is also the length of the n-th boundary segment in the zig-zag path of the above diagram, between the two types of numbers, as shown below for n = 1..10:
.
.                       |_ _ _
.                             |_ _
.                                 |_ _
.                                     |_
.                                       |
.                                       |_ _
.
The sequence begins:    1,3,1,2,1,2,1,1,2,2,...
.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(nb = 1, isp = 0); forstep (n=3, nn, 2, if (bitxor(isp, ! isprime(n)), nb++, print1(nb, ", "); nb = 1; isp = ! isp););} \\ Michel Marcus, May 25 2015

Formula

a(n) = A256252(n-1), n >= 3.

A142723 Decimal expansion of the continued fraction whose terms are half the gaps of the odd nonprimes A014076.

Original entry on oeis.org

4, 3, 0, 3, 2, 3, 9, 3, 0, 1, 9, 8, 3, 1, 2, 2, 5, 4, 7, 5, 0, 7, 2, 5, 6, 5, 3, 7, 1, 2, 9, 4, 6, 1, 0, 1, 1, 0, 0, 5, 8, 7, 4, 9, 8, 2, 5, 6, 1, 5, 9, 3, 3, 2, 7, 6, 9, 9, 6, 6, 3, 7, 1, 8, 1, 0, 8, 6, 7, 0, 5, 5, 2, 1, 6, 2, 6, 3, 9, 5, 7, 8, 9, 0, 1, 9, 6, 0, 0, 2, 4, 3, 7, 4, 8, 7, 1, 5, 5, 8, 7, 3, 6, 9, 2
Offset: 1

Views

Author

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

Keywords

Comments

Take half of the first difference of odd nonprimes A014076 and treat it as a continued fraction. This sequence gives the decimal expansion of that number. - Charles R Greathouse IV, Feb 03 2011

Examples

			4.30323930198312254750725653712946101100587498256159332769966371810867...
		

Programs

  • Mathematica
    a = Flatten[Table[If[PrimeQ[2*n + 1], {}, 2*n - 1], {n, 0, 200}]]; b = Table[(a[[n + 1]] - a[[n]])/2, {n, 1, Length[a] - 1}]; FromContinuedFraction[b]; c = N[%, 200]; Table[Floor[Mod[c*10^n, 10]], {n, 0, 201}] (* Bagula and Adamson *)
    RealDigits[FromContinuedFraction[Differences[Select[Range[-1, 399, 2], !PrimeQ[# + 2]&]]/2], 10, 201][[1]] (* Charles R Greathouse IV, Feb 03 2011 *)
  • PARI
    a=contfracpnqn(D(select(vector(99,n,2*n-1),x->!isprime(x)))/2); a[1,1]/a[2,1]*1.  /* OK for 35 digits. For D(.) see A137822 */ \\ M. F. Hasler, Sep 29 2011

A239114 Exponent of 2 in prime factorization (i.e., 2-adic valuation) of odd nonprimes A014076(n) + 1.

Original entry on oeis.org

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

Views

Author

K. G. Stier, Mar 10 2014

Keywords

Comments

Sequence is counterpart to A023512, i.e., merging these two sequences gives the ruler function A001511.

Examples

			a(13) = 3, because the 13th odd nonprime is 55, and the largest power of 2 dividing 55+1 is 3.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {forstep(n=1, nn, 2, if (! isprime(n), print1(valuation(n+1, 2), ", ")););} \\ Michel Marcus, Mar 13 2014

Formula

a(n) = A001511((A014076(n)+1)/2)

A062533 a(n) = A000010(A014076(n)).

Original entry on oeis.org

1, 6, 8, 12, 20, 18, 20, 24, 24, 24, 42, 32, 40, 36, 36, 48, 44, 40, 60, 54, 64, 56, 72, 60, 72, 60, 48, 72, 88, 72, 96, 110, 80, 100, 84, 108, 72, 92, 120, 112, 84, 96, 120, 104, 132, 80, 156, 108, 120, 116, 120, 144, 160, 108, 96, 132, 168, 160, 132, 180, 140, 168
Offset: 1

Views

Author

Jason Earls, Jul 10 2001

Keywords

Crossrefs

Subset of the totients of the odds (A037225).

Programs

  • Mathematica
    A014076 := Select[Range[1, 350, 2], PrimeOmega[#] != 1 &]; Table[ EulerPhi[A014076[[n]]], {n, 1, 50}] (* G. C. Greubel, Sep 17 2017 *)
  • PARI
    je=[]; forstep(n=1,301,2, if(isprime(n), n+1,je=concat(je,eulerphi(n)))); je
    
  • Python
    from sympy import primepi, totient
    def A062533(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 totient(m) # Chai Wah Wu, Jul 31 2024

A163631 Partial sums of the odd nonprimes, A014076.

Original entry on oeis.org

1, 10, 25, 46, 71, 98, 131, 166, 205, 250, 299, 350, 405, 462, 525, 590, 659, 734, 811, 892, 977, 1064, 1155, 1248, 1343, 1442, 1547, 1658, 1773, 1890, 2009, 2130, 2253, 2378, 2507, 2640, 2775, 2916, 3059, 3204, 3351, 3504, 3659, 3818, 3979, 4144, 4313
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 02 2009, Oct 10 2009

Keywords

Comments

All entries besides the first are of the form 2+(k+1)^2-A007504(j), e.g., 10=2+25-17, 25=2+64-41, where the square is the sum of all odd numbers up to 1+2*k, and the 2 and A007504 represent the partial sum over the primes.

Crossrefs

Cf. A014076.

Programs

  • Mathematica
    upto=200; Accumulate[Complement[Range[1,upto,2], Prime[Range[2,PrimePi[upto]]]]] (* Harvey P. Dale, Mar 19 2011 *)
  • PARI
    lista(nn) = {my(s = 0); forstep (n=1, nn, 2, if (!isprime(n), s+= n; print1(s, ", ")););} \\ Michel Marcus, Aug 01 2017

Formula

a(n) = Sum_{x= 1st odd nonprime..n-th odd nonprime}x.

Extensions

150 replaced with 250 by R. J. Mathar, Aug 06 2009
Showing 1-10 of 80 results. Next