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

A137622 Inverse of A137621.

Original entry on oeis.org

1, 2, 4, 3, 8, 5, 11, 6, 7, 9, 18, 10, 22, 12, 13, 14, 29, 15, 33, 16, 17, 19, 40, 20, 21, 23, 24, 25, 51, 26, 54, 27, 28, 30, 31, 32, 64, 34, 35, 36, 72, 37, 76, 38, 39, 41, 84, 42, 43, 44, 45, 46, 94, 47, 48, 49, 50, 52, 104, 53, 109, 55, 56, 57, 58, 59, 120, 60, 61, 62, 127
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 30 2008

Keywords

A137623 A137621(A137621(n)).

Original entry on oeis.org

1, 2, 3, 4, 8, 5, 10, 6, 12, 14, 9, 16, 18, 20, 11, 24, 25, 7, 13, 27, 28, 15, 30, 32, 33, 34, 36, 19, 21, 38, 39, 40, 22, 44, 45, 23, 48, 50, 51, 26, 52, 55, 56, 57, 29, 58, 31, 62, 63, 64, 17, 65, 68, 35, 70, 72, 37, 74, 75, 77, 78, 80, 41, 42, 84, 85, 43, 86, 87, 90, 91, 46
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 30 2008

Keywords

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

A120632 Number of numbers >1 up to 2*prime(n) which are divisible by primes up to prime(n).

Original entry on oeis.org

2, 4, 8, 11, 18, 22, 29, 33, 40, 51, 54, 64, 72, 76, 84, 94, 104, 109, 120, 127, 132, 142, 150, 161, 174, 181, 186, 194, 199, 207, 230, 238, 248, 252, 270, 275, 285, 297, 305, 317, 327, 331, 349, 353, 361, 365, 386, 407, 415, 419, 426, 438, 442, 460, 471, 482
Offset: 1

Views

Author

Lekraj Beedassy, Jun 21 2006

Keywords

Comments

The first prime(n+1)-2 numbers >1 are divisible by primes up to prime(n).
Complement of A137624; A137621(a(n))=A000040(n); A137621(a(n)+1)=A100484(n). - Reinhard Zumkeller, Jan 30 2008

Examples

			a(4)=11 because exactly 11 numbers between 2 and 2*prime(4)=2*7=14, namely: 2,3,4,5,6,7,8,9,10,12,14 are divisible by the first four primes 2,3,5,7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p;
       p:= ithprime(n); 2*p - numtheory:-pi(2*p)+n-1
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 02 2022
  • PARI
    a(n) = {nb = 0; for (i = 2, 2*prime(n), for (ip = 1, n, if ( !(i % prime(ip)), nb++; break;););); nb;} \\ Michel Marcus, Oct 26 2013

Formula

a(n) = A120633(n) + A040976(n+1) = A076274(n) - A070046(n).

A137624 Complement of A120632.

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 10, 12, 13, 14, 15, 16, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 85, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 30 2008

Keywords

Comments

A137621(a(n)) = A018252(n).
Showing 1-5 of 5 results.