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 1063 results. Next

A018252 The nonprime numbers: 1 together with the composite numbers, A002808.

Original entry on oeis.org

1, 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, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88
Offset: 1

Views

Author

Keywords

Comments

d(a(n)) != 2 (cf. A000005). - Juri-Stepan Gerasimov, Oct 17 2009
Number of prime divisors of a(n) (counted with multiplicity) != 1. - Juri-Stepan Gerasimov, Oct 30 2009
Largest nonprime < n-th composite. - Juri-Stepan Gerasimov, Oct 29 2009
The nonnegative nonprimes A141468 without zero; the natural nonprimes; the whole nonprimes; the counting nonprimes. If the nonprime numbers A141468 which are also the nonnegative integers A001477, then the nonprimes A141468 also called the nonnegative nonprimes. If the nonprime numbers A018252 which are also the natural (or whole or counting) numbers A000027, then the nonprimes A018252 also called the natural nonprimes, the whole nonprimes and the counting nonprimes. - Juri-Stepan Gerasimov, Nov 22 2009
Smallest nonprime > n-th nonnegative nonprime. - Juri-Stepan Gerasimov, Dec 04 2009
a(n) = A175944(A014284(n)) = A175944(A175965(n)). - Reinhard Zumkeller, Mar 18 2011

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 2.

Crossrefs

Cf. A000040 (complement), A002808.
Boustrophedon transforms: A230955, A230954.

Programs

  • GAP
    A018252 := Difference([1..10^5], Filtered([1..10^5], IsPrime)); # Muniru A Asiru, Oct 21 2017
    
  • Haskell
    a018252 n = a018252_list !! (n-1)
    a018252_list = filter ((== 0) . a010051) [1..]
    -- Reinhard Zumkeller, Mar 31 2014
    
  • Magma
    [n : n in [1..100] | not IsPrime(n) ];
    
  • Maple
    with(numtheory); sort(convert(convert([ seq(i,i=1..541) ],set) minus convert([ seq(ithprime(i),i=1..100) ],set),list));
    seq(`if`(not isprime(n),n,NULL),n=1..88); # Peter Luschny, Jul 29 2009
    A018252 := proc(n) option remember; if n = 1 then 1; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do; end if; end proc: # R. J. Mathar, Oct 22 2010
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; Array[ nonPrime, 75] (* Robert G. Wilson v, Jan 29 2015, based on the algorithm by Labos Elemer in A006508 *)
    max = 90; Complement[Range[max], Prime[Range[PrimePi[max]]]] (* Harvey P. Dale, Aug 12 2011 *)
    Join[{1}, Select[Range[100], CompositeQ]] (* Jean-François Alcover, Nov 07 2021 *)
  • PARI
    isA018252(n) = !isprime(n)
    A018252(n) = {local(a,b);b=n;a=1;while(a!=b,a=b;b=n+primepi(a));b} \\ Michael B. Porter, Nov 06 2009
    
  • PARI
    a(n) = my(k=0); while(-n+n-=k-k=primepi(n), ); n; \\ Ruud H.G. van Tol, Jul 15 2024 (after code in A002808)
    
  • Python
    from sympy import isprime
    def ok(n): return not isprime(n)
    print([k for k in range(1, 89) if ok(k)]) # Michael S. Branicky, Nov 10 2022
    
  • Python
    from sympy import composite
    def A018252(n): return 1 if n == 1 else composite(n-1) # Chai Wah Wu, Nov 15 2022
  • Sage
    def A018252_list(n) :
        return [k for k in (1..n) if not k.is_prime()]
    A018252_list(88)  # Peter Luschny, Feb 03 2012
    

Formula

Let b(0) = n + pi(n) and b(n+1) = n + pi(b(n)), with pi(n) = A000720(n); then a(n) is the limit value of b(n). - Floor van Lamoen, Oct 08 2001
a(n) = A137621(A137624(n)). - Reinhard Zumkeller, Jan 30 2008
A010051(a(n)) = 0. - Reinhard Zumkeller, Mar 31 2014
A239968(a(n)) = n. - Reinhard Zumkeller, Dec 02 2014

A073445 Second differences of A002808, the sequence of composites.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Aug 01 2002

Keywords

Examples

			From _Gus Wiseman_, Oct 10 2024: (Start)
The composite numbers (A002808) are:
  4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, ...
with first differences (A073783):
  2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, ...
with first differences (A073445):
  0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, ...
(End)
		

Crossrefs

Also first differences of A054546.
For first differences we had A073783 (ones A375929), run-lengths A376680.
Positions of zeros are A376602.
Positions of nonzeros are A376603.
Positions of ones are A376651, negative-ones A376652.
A002808 lists the composite numbers.
A064113 lists positions of adjacent equal prime gaps.
A333254 gives run-lengths of differences between consecutive primes.
Other second differences: A036263 (prime), A376590 (squarefree), A376596 (prime-power), A376604 (Kolakoski).

Programs

  • Haskell
    a073445 n = a073445_list !! (n-1)
    a073445_list = zipWith (-) (tail a073783_list) a073783_list
    -- Reinhard Zumkeller, Jan 10 2013
    
  • Mathematica
    c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x]; Table[c[w+2]-2*c[w+1]+c[w], {w, 200}]
    (* second program *)
    Differences[Select[Range[100],CompositeQ],2] (* Gus Wiseman, Oct 08 2024 *)
  • Python
    from sympy import primepi
    def A073445(n):
        def iterfun(f,n=0):
            m, k = n, f(n)
            while m != k: m, k = k, f(k)
            return m
        return (a:=iterfun(f:=lambda x:n+primepi(x)+1,n))-((b:=iterfun(lambda x:f(x)+1,a))<<1)+iterfun(lambda x:f(x)+2,b) # Chai Wah Wu, Oct 03 2024

Formula

a(n) = c(n+2)-2*c(n+1)+c(n), where c(n) = A002808(n).
a(n) = A073783(n+1) - A073783(n). - Reinhard Zumkeller, Jan 10 2013

A227413 a(1)=1, a(2n)=nthprime(a(n)), a(2n+1)=nthcomposite(a(n)), where nthprime = A000040, nthcomposite = A002808.

Original entry on oeis.org

1, 2, 4, 3, 6, 7, 9, 5, 8, 13, 12, 17, 14, 23, 16, 11, 10, 19, 15, 41, 22, 37, 21, 59, 27, 43, 24, 83, 35, 53, 26, 31, 20, 29, 18, 67, 30, 47, 25, 179, 58, 79, 34, 157, 54, 73, 33, 277, 82, 103, 40, 191, 62, 89, 36, 431, 114, 149, 51, 241, 75, 101, 39, 127, 46
Offset: 1

Views

Author

Antti Karttunen, Jul 10 2013

Keywords

Comments

Inverse permutation of A135141.
Shares with A073846 the property that the other bisection consists of just primes and the other bisection of just nonprimes.

Crossrefs

Similarly constructed permutations: A227402, A227404, A227410, A227412. Cf. also A073846, A209636.

Programs

  • Haskell
    import Data.List (transpose)
    a227413 n = a227413_list !! (n-1)
    a227413_list = 1 : concat (transpose [map a000040 a227413_list,
                                          map a002808 a227413_list])
    -- Reinhard Zumkeller, Jan 29 2014

Formula

a(1)=1, a(2n) = A000040(a(n)), a(2n+1) = A002808(a(n)).
A007097(n) = a(A000079(n)).

A377033 Array read by antidiagonals downward where A(n,k) is the n-th term of the k-th differences of the composite numbers (A002808).

Original entry on oeis.org

4, 6, 2, 8, 2, 0, 9, 1, -1, -1, 10, 1, 0, 1, 2, 12, 2, 1, 1, 0, -2, 14, 2, 0, -1, -2, -2, 0, 15, 1, -1, -1, 0, 2, 4, 4, 16, 1, 0, 1, 2, 2, 0, -4, -8, 18, 2, 1, 1, 0, -2, -4, -4, 0, 8, 20, 2, 0, -1, -2, -2, 0, 4, 8, 8, 0, 21, 1, -1, -1, 0, 2, 4, 4, 0, -8, -16, -16
Offset: 0

Views

Author

Gus Wiseman, Oct 17 2024

Keywords

Comments

Row n is the k-th differences of A002808 = the composite numbers.

Examples

			Array begins:
        n=1:  n=2:  n=3:  n=4:  n=5:  n=6:  n=7:  n=8:  n=9:
  ----------------------------------------------------------
  k=0:   4     6     8     9    10    12    14    15    16
  k=1:   2     2     1     1     2     2     1     1     2
  k=2:   0    -1     0     1     0    -1     0     1     0
  k=3:  -1     1     1    -1    -1     1     1    -1    -1
  k=4:   2     0    -2     0     2     0    -2     0     2
  k=5:  -2    -2     2     2    -2    -2     2     2    -2
  k=6:   0     4     0    -4     0     4     0    -4    -1
  k=7:   4    -4    -4     4     4    -4    -4     3    10
  k=8:  -8     0     8     0    -8     0     7     7   -29
  k=9:   8     8    -8    -8     8     7     0   -36    63
Triangle begins:
    4
    6    2
    8    2    0
    9    1   -1   -1
   10    1    0    1    2
   12    2    1    1    0   -2
   14    2    0   -1   -2   -2    0
   15    1   -1   -1    0    2    4    4
   16    1    0    1    2    2    0   -4   -8
   18    2    1    1    0   -2   -4   -4    0    8
   20    2    0   -1   -2   -2    0    4    8    8    0
   21    1   -1   -1    0    2    4    4    0   -8  -16  -16
		

Crossrefs

Initial rows: A002808, A073783, A073445.
The version for primes is A095195 or A376682.
A version for partitions is A175804, cf. A053445, A281425, A320590.
Triangle row-sums are A377034, absolute version A377035.
Column n = 1 is A377036, for primes A007442 or A030016.
First position of 0 in each row is A377037.
Other arrays of differences: A095195 (prime), A376682 (noncomposite), A377033 (composite), A377038 (squarefree), A377046 (nonsquarefree), A377051 (prime-power).
A000040 lists the primes, differences A001223, seconds A036263.
A008578 lists the noncomposites, differences A075526.
Cf. A065310, A065890, A084758, A173390, A350004, A376602 (zero), A376603 (nonzero), A376651 (positive), A376652 (negative), A376680.

Programs

  • Mathematica
    nn=9;
    t=Table[Take[Differences[NestList[NestWhile[#+1&, #+1,PrimeQ]&,4,2*nn],k],nn],{k,0,nn}]

Formula

A(i,j) = Sum_{k=0..j} (-1)^(j-k) binomial(j,k) A002808(i+k).

A246377 Permutation of natural numbers: a(1) = 1, a(p_n) = 2*a(n)+1, a(c_n) = 2*a(n), where p_n = n-th prime = A000040(n), c_n = n-th composite number = A002808(n).

Original entry on oeis.org

1, 3, 7, 2, 15, 6, 5, 14, 4, 30, 31, 12, 13, 10, 28, 8, 11, 60, 29, 62, 24, 26, 9, 20, 56, 16, 22, 120, 61, 58, 63, 124, 48, 52, 18, 40, 25, 112, 32, 44, 27, 240, 21, 122, 116, 126, 57, 248, 96, 104, 36, 80, 17, 50, 224, 64, 88, 54, 23, 480, 121, 42, 244, 232, 252, 114, 59, 496, 192, 208, 125, 72, 49, 160, 34, 100
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2014

Keywords

Comments

This permutation is otherwise like Katarzyna Matylla's A135141, except that the role of even and odd numbers (or alternatively: primes and composites) has been swapped.
Because 2 is the only even prime, it implies that, apart from a(2)=3, odd numbers occur in odd positions only (along with many even numbers that also occur in odd positions).
This also implies that for each odd composite (A071904) there exists a separate infinite cycle in this permutation, apart from 9 and 15 which are in the same infinite cycle: (..., 23, 9, 4, 2, 3, 7, 5, 15, 28, 120, 82, 46, ...).

Crossrefs

Inverse: A246378.
Other related or similar permutations: A135141, A054429, A246201, A245703, A246376, A246379, A243071, A246681, A236854.
Differs from A237427 for the first time at n=19, where a(19) = 29, while A237427(19) = 62.

Formula

a(1) = 1, and for n > 1, if A010051(n) = 1 [i.e. when n is a prime], a(n) = 1+(2*a(A000720(n))), otherwise a(n) = 2*a(A065855(n)).
As a composition of related permutations:
a(n) = A054429(A135141(n)).
a(n) = A135141(A236854(n)).
a(n) = A246376(A246379(n)).
a(n) = A246201(A245703(n)).
a(n) = A243071(A246681(n)). [For n >= 1].
Other identities.
For all n > 1 the following holds:
A000035(a(n)) = A010051(n). [Maps primes to odd numbers > 1, and composites to even numbers, in some order. Permutations A246379 & A246681 have the same property].

A291925 A(n,k) is the n-th Rhonda number to base A002808(k), the k-th composite number; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

10206, 855, 11935, 1836, 1029, 12150, 15540, 6318, 3813, 16031, 1568, 21054, 6622, 5577, 45030, 560, 2835, 25331, 10530, 7040, 94185, 11475, 800, 4752, 44360, 14500, 7304, 113022, 2392, 18655, 3993, 5265, 44660, 14739, 15104, 114415, 1000, 2472, 20565, 4425, 5439, 44733, 17655, 19136, 191149
Offset: 1

Views

Author

Alois P. Heinz, Sep 05 2017

Keywords

Comments

Integer m is Rhonda number to base b if the product of its base-b digits divided by b is equal to the integer log of m, A001414(m). This can only happen if b is a composite number, b in {A002808}.

Examples

			A(1,2) = 855 is the first and smallest term of column k=2. The second composite number is A002808(2) = 6.  855 = (((3*6)+5)*6+4)*6+3 = 3543_6 = 3*3*5*19. And (3*5*4*3)/6 = A001414(855) = 3+3+5+19 = 30.
Square array A(n,k) begins:
:  10206,   855,  1836, 15540, 1568,  560, 11475, ...
:  11935,  1029,  6318, 21054, 2835,  800, 18655, ...
:  12150,  3813,  6622, 25331, 4752, 3993, 20565, ...
:  16031,  5577, 10530, 44360, 5265, 4425, 29631, ...
:  45030,  7040, 14500, 44660, 5439, 4602, 31725, ...
:  94185,  7304, 14739, 44733, 5664, 4888, 45387, ...
: 113022, 15104, 17655, 47652, 5824, 7315, 58404, ...
		

Crossrefs

Row n=1 gives A255872.
Main diagonal gives A255880.

A245704 Permutation of natural numbers: a(1) = 1, a(A014580(n)) = A000040(a(n)), a(A091242(n)) = A002808(a(n)), where A000040(n) = n-th prime, A002808(n) = n-th composite number, and A014580(n) and A091242(n) are binary codes for n-th irreducible and n-th reducible polynomial over GF(2), respectively.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 5, 9, 12, 15, 7, 10, 13, 16, 21, 25, 14, 18, 19, 22, 26, 33, 38, 24, 11, 28, 30, 34, 39, 49, 23, 55, 36, 20, 42, 45, 37, 50, 56, 69, 47, 35, 77, 52, 32, 60, 17, 64, 54, 70, 78, 94, 66, 51, 29, 105, 74, 48, 41, 84, 53, 27, 88, 76, 95, 106, 73, 125, 91, 72, 44, 140, 97, 100, 68, 58, 115, 75, 40
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

All the permutations A091203, A091205, A106443, A106445, A106447, A235042 share the same property that the binary representations of irreducible GF(2) polynomials (A014580) are mapped bijectively to the primes (A000040) but while they determine the mapping of corresponding reducible polynomials (A091242) to the composite numbers (A002808) by a simple multiplicative rule, this permutation employs index-recursion also in that case.

Crossrefs

Programs

Formula

a(1) = 1, after which, if A091225(n) is 1 [i.e. n is in A014580], then a(n) = A000040(a(A091226(n))), otherwise a(n) = A002808(a(A091245(n))).
As a composition of related permutations:
a(n) = A227413(A245701(n)).
a(n) = A245822(A091205(n)).
Other identities. For all n >= 1, the following holds:
a(A091230(n)) = A007097(n). [Maps iterates of A014580 to the iterates of primes. Permutation A091205 has the same property].
A010051(a(n)) = A091225(n). [After a(1)=1, maps binary representations of irreducible GF(2) polynomials (= A014580) to primes and the corresponding representations of reducible polynomials to composites].

A246378 Permutation of natural numbers: a(1) = 1, a(2n) = nthcomposite(a(n)), a(2n+1) = nthprime(a(n)), where nthcomposite = A002808, nthprime = A000040.

Original entry on oeis.org

1, 4, 2, 9, 7, 6, 3, 16, 23, 14, 17, 12, 13, 8, 5, 26, 53, 35, 83, 24, 43, 27, 59, 21, 37, 22, 41, 15, 19, 10, 11, 39, 101, 75, 241, 51, 149, 114, 431, 36, 89, 62, 191, 40, 103, 82, 277, 33, 73, 54, 157, 34, 79, 58, 179, 25, 47, 30, 67, 18, 29, 20, 31, 56, 167, 134, 547, 102, 379, 304, 1523, 72, 233
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2014

Keywords

Comments

Contains an infinite number of infinite cycles. See comments at A246377.

Crossrefs

Inverse: A246377.
Similar or related permutations: A237126, A054429, A227413, A236854, A246375, A246380, A246682, A163511.

Programs

Formula

a(1) = 1, a(2n) = nthcomposite(a(n)), a(2n+1) = nthprime(a(n)), where nthcomposite = A002808, nthprime = A000040.
As a composition of related permutations:
a(n) = A227413(A054429(n)).
a(n) = A236854(A227413(n)).
a(n) = A246380(A246375(n)).
a(n) = A246682(A163511(n)). [For n >= 1].
Other identities. For all n > 1 the following holds:
A010051(a(n)) = A000035(n). [Maps odd numbers larger than one to primes, and even numbers to composites, in some order. Permutations A246380 & A246682 have the same property].

A376602 Inflection and undulation points in the sequence of composite numbers (A002808).

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 14, 15, 16, 18, 20, 21, 22, 25, 27, 29, 32, 33, 34, 37, 38, 39, 41, 43, 44, 45, 48, 50, 52, 53, 54, 57, 60, 61, 62, 65, 66, 67, 68, 69, 72, 74, 76, 78, 80, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 99, 100, 101, 103, 105, 106, 107, 108
Offset: 1

Views

Author

Gus Wiseman, Oct 05 2024

Keywords

Comments

These are points at which the second differences (A073445) are zero.

Examples

			The composite numbers (A002808) are:
  4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, ...
with first differences (A073783):
  2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, ...
with first differences (A073445):
  0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, 0, ...
with zeros at (A376602):
  1, 3, 5, 7, 9, 11, 14, 15, 16, 18, 20, 21, 22, 25, 27, 29, 32, 33, 34, 37, 38, ...
		

Crossrefs

Partitions into composite numbers are counted by A023895, factorizations A050370.
For prime instead of composite we have A064113.
These are the positions of zeros in A073445.
For first differences we had A073783, ones A375929, complement A065890.
For concavity in primes we have A258025/A258026, weak A333230/A333231.
For upward concavity (instead of zero) we have A376651, downward A376652.
The complement is A376603.
For composite numbers: A002808 (terms), A073783 (first differences), A073445 (second differences), A376603 (nonzero curvature), A376651 (concave-up), A376652 (concave-down).
For inflection and undulation points: A064113 (prime), A376588 (non-perfect-power), A376591 (squarefree), A376594 (nonsquarefree), A376597 (prime-power), A376600 (non-prime-power).

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],CompositeQ],2],0]

A376760 Let c(n) = A002808(n) denote the n-th composite number; a(n) = number of composite numbers c with c(n) <= c <= 2*c(n).

Original entry on oeis.org

3, 5, 7, 7, 7, 9, 12, 12, 12, 15, 17, 17, 17, 19, 20, 21, 21, 22, 24, 26, 27, 27, 28, 28, 30, 31, 31, 33, 36, 36, 37, 40, 40, 41, 41, 41, 43, 43, 44, 44, 45, 48, 51, 52, 52, 53, 53, 56, 56, 56, 59, 62, 62, 62, 63, 64, 66, 67, 67, 69, 70, 71, 71, 72, 74, 74, 75, 76, 77, 78, 78, 80, 80, 80, 83, 86, 87, 87, 90, 93, 94, 94, 96, 96, 97, 97, 98, 99, 99, 99, 100, 101, 102, 103
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2024

Keywords

Comments

There are three other versions: composite c with c(n) < c < 2*c(n): a(n)-2; c(n) <= c < 2*c(n): a(n) - 1; and c(n) < c <= 2*c(n): also a(n) - 1.

Examples

			The 5th composite number is 10, and 10, 12, 14, 15, 16, 18, 20 are composite, so a(5) = 7.
		

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Maple
    chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855
    t := []: for n from 2 to 200000 do if not isprime(n) then t := [op(t), n]; fi; od: # precompute A002808
    ithchi := proc(n) t[n]; end: # returns n-th composite number A002808 for any n <= 182015, analogous to ithprime
    A376760 := proc(n) chi(2*ithchi(n)) - n + 1; end;
    [seq(A376760(n),n=1..120)];
  • Mathematica
    MapIndexed[2*# - PrimePi[2*#] - #2[[1]] &, Select[Range[100], CompositeQ]] (* Paolo Xausa, Oct 22 2024 *)
  • Python
    from sympy import composite, primepi
    def A376760(n): return (m:=composite(n)<<1)-primepi(m)-n # Chai Wah Wu, Oct 22 2024

Formula

a(n) = 2*A002808(n) - A000720(2*A002808(n)) - n. - Paolo Xausa, Oct 22 2024
Showing 1-10 of 1063 results. Next