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

A141468 Zero together with the nonprime numbers A018252.

Original entry on oeis.org

0, 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

Juri-Stepan Gerasimov, Aug 11 2008

Keywords

Comments

0 and 1 together with the composite numbers (A002808). - Omar E. Pol, Jul 04 2009

Crossrefs

Cf. A018252, A002808, A054546 (first differences).

Programs

  • Haskell
    a141468 n = a141468_list !! (n-1)
    a141468_list = 0 : a018252_list  -- Reinhard Zumkeller, May 31 2013
    
  • Maple
    A141468 := proc(n) option remember; local a; if n <=2 then n-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, Dec 13 2010
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; Array[ nonPrime, 66, 0] (* Robert G. Wilson v, Jan 29 2015 *)
    Join[{0,1},Select[Range[100],CompositeQ]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 22 2017 *)
  • PARI
    a(n) = my(k=0); n--; while(-n+n+=-k+k=primepi(n), ); n; \\ Ruud H.G. van Tol, Jul 15 2024
    
  • PARI
    list(lim)=if(lim<1, return(if(lim<0,[],[0]))); my(v=List([0,1])); forcomposite(n=4,lim\1, listput(v,n)); Vec(v) \\ Charles R Greathouse IV, Jul 15 2024
    
  • Python
    from sympy import composite
    def A141468(n): return n-1 if n < 3 else composite(n-2) # Chai Wah Wu, Oct 11 2024

Formula

a(1) = 0; a(n) = A018252(n-1), n > 1. - Omar E. Pol, Aug 13 2009
a(n) = A018252(n) - A054546(n). - Omar E. Pol, Oct 21 2011
a(n) = A002808(n-2) for n > 2 . - Robert G. Wilson v, Jan 29 2015, corrected by Rémi Guillaume, Aug 26 2024.

Extensions

Added 68 by R. J. Mathar, Aug 14 2008
Better definition from Omar E. Pol, Jun 30 2009

A078782 Nonprimes (A018252) with prime (A000040) subscripts.

Original entry on oeis.org

4, 6, 9, 12, 18, 21, 26, 28, 34, 42, 45, 52, 57, 60, 65, 74, 81, 84, 91, 95, 98, 106, 112, 119, 128, 133, 135, 141, 143, 147, 165, 170, 177, 180, 192, 195, 203, 209, 214, 220, 228, 231, 244, 246, 250, 253, 267, 284, 288, 290, 295, 301, 303, 316, 323, 329, 336
Offset: 1

Views

Author

Joseph L. Pe, Jan 09 2003

Keywords

Comments

a(n) = A018252(A000040(n)). Subsequence of A175250 (nonprimes (A018252) with noncomposite (A008578) subscripts), a(n) = A175250(n+1). a(n) U A102615(n) = A018252(n). [From Jaroslav Krizek, Mar 13 2010]

Examples

			a(4) = nonprime(prime(4)) = nonprime(7) = 12.
		

Crossrefs

Let A = primes A000040, B = nonprimes A018252. The 2-level compounds are AA = A006450, AB = A007821, BA = A078782, BB = A102615. The 3-level compounds AAA, AAB, ..., BBB are A038580, A049078, A270792, A102617, A270794, A270796, A102216.

Programs

  • Python
    from sympy import prime, composite
    def A078782(n): return composite(prime(n)-1) # Chai Wah Wu, Nov 13 2024

Extensions

Corrected by Jaroslav Krizek, Mar 13 2010

A239968 a(n) = 0 unless n is a nonprime A018252(k) then a(n) = k.

Original entry on oeis.org

1, 0, 0, 2, 0, 3, 0, 4, 5, 6, 0, 7, 0, 8, 9, 10, 0, 11, 0, 12, 13, 14, 0, 15, 16, 17, 18, 19, 0, 20, 0, 21, 22, 23, 24, 25, 0, 26, 27, 28, 0, 29, 0, 30, 31, 32, 0, 33, 34, 35, 36, 37, 0, 38, 39, 40, 41, 42, 0, 43, 0, 44, 45, 46, 47, 48, 0, 49, 50, 51, 0, 52
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 30 2014

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr, genericIndex)
    a239968 n = genericIndex a239968_list (n - 1)
    a239968_list = unfoldr c (1, 1, a018252_list) where
       c (i, z, xs'@(x:xs)) | i == x = Just (z, (i + 1, z + 1, xs))
                            | i /= x = Just (0, (i + 1, z, xs'))
  • Mathematica
    Module[{k = 0}, Array[If[!PrimeQ[#], ++k, 0] &, 100]] (* Paolo Xausa, Jul 31 2025 *)

Formula

a(n) = A066246(n) - A010051(n) + 1.
a(n) = A026233(n) - A049084(n);
A057427(a(n)) = A005171(n).
a(n) = A062298(n)*A005171(n). - Ridouane Oudra, Jul 29 2025

A375926 Numbers k such that A018252(k+1) = A018252(k) + 1. In other words, the k-th nonprime number is 1 less than the next.

Original entry on oeis.org

4, 5, 8, 9, 12, 13, 15, 16, 17, 18, 21, 22, 23, 24, 26, 27, 30, 31, 33, 34, 35, 36, 38, 39, 40, 41, 44, 45, 46, 47, 49, 50, 53, 54, 55, 56, 58, 59, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 73, 74, 77, 78, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
Offset: 1

Views

Author

Gus Wiseman, Sep 11 2024

Keywords

Examples

			The nonprime numbers are 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, ... which increase by 1 after term 4, term 5, term 8, etc.
		

Crossrefs

The complement appears to be A014689, except the first term.
Positions of 1's in A065310 (see also A054546, A073783).
First differences are A373403 (except first).
The version for non-prime-powers is A375713, differences A373672.
The version for prime-powers is A375734, differences A373671.
The version for non-perfect-powers is A375740.
The version for composite numbers is A375929.
A000040 lists the prime numbers, differences A001223.
A018252 lists the nonprimes, exclusive A002808.
A046933 counts composite numbers between primes.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],!PrimeQ[#]&]],1]
  • Python
    from sympy import primepi
    def A375926(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+bisection(lambda y:primepi(x+1+y))-1
        return bisection(f,n,n) # Chai Wah Wu, Sep 15 2024

A175967 Lexicographically earliest sequence with first differences as increasing sequence of nonprimes A018252.

Original entry on oeis.org

1, 2, 6, 12, 20, 29, 39, 51, 65, 80, 96, 114, 134, 155, 177, 201, 226, 252, 279, 307, 337, 369, 402, 436, 471, 507, 545, 584, 624, 666, 710, 755, 801, 849, 898, 948, 999, 1051, 1105, 1160, 1216, 1273, 1331, 1391, 1453, 1516, 1580, 1645, 1711, 1779
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Comments

Complement of A175968.

Crossrefs

Programs

  • Haskell
    a175967 n = a175967_list !! n
    a175967_list = scanl (+) 1 a018252_list
    -- Reinhard Zumkeller, Mar 26 2015

Formula

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

A141218 Write the n-th nonprime (A018252(n)) as a product of primes; decrease one copy of the largest prime by 1 and increase one copy of the smallest prime by 1, multiply the resulting numbers.

Original entry on oeis.org

1, 3, 6, 6, 8, 12, 12, 18, 16, 12, 18, 24, 24, 30, 24, 24, 36, 24, 36, 36, 24, 40, 48, 36, 36, 54, 48, 48, 54, 60, 48, 66, 48, 48, 60, 64, 72, 54, 60, 72, 72, 84, 72, 90, 72, 48, 72, 90, 96, 88, 90, 72, 108, 80, 108, 80, 108, 96, 72, 120, 108, 96, 126, 112, 120, 108, 96, 132, 120
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 07 2008

Keywords

Examples

			1st nonprime = 1 (has no prime factors); a(1) = empty product = 1.
2nd nonprime = 4 = (p(max)=2)*(p(min)=2); a(2) = (2-1)*(2+1) = 1*3 = 3.
3rd nonprime = 6 = (p(max)=3)*(p(min)=2); a(3) = (3-1)*(2+1) = 2*3 = 6.
4th nonprime = 8 = (p(max)=2)*(p=2)*(p(min)=2); a(4) = (2-1)*2*(2+1) = 1*2*3 = 6.
		

Crossrefs

Programs

  • Maple
    f:= proc(m) local F,p1,p2;
      if isprime(m) then return NULL fi;
      F:= numtheory:-factorset(m);
      p1:= min(F); p2:= max(F);
      m*(p1+1)/p1*(p2-1)/p2;
    end proc:
    1, seq(f(i),i=2..200); # Robert Israel, Oct 08 2018
  • Mathematica
    npr={};Do[If[!PrimeQ[i],AppendTo[npr,i]],{i,2,93}];f[k_]:=k*(FactorInteger[k][[1,1]]+1)/FactorInteger[k][[1,1]]*(FactorInteger[k][[-1,1]]-1)/FactorInteger[k][[-1,1]];Join[{1},f/@npr] (* James C. McMahon, Jul 18 2025 *)

Extensions

Three terms corrected by R. J. Mathar, Aug 18 2008
Entry revised by N. J. A. Sloane, Mar 07 2014
Examples revised by Jon E. Schoenfield, Mar 08 2014

A175968 Complement of A175967(n), where A175967(n) = the lexicographically earliest sequence with first differences as increasing sequence of nonprimes A018252(n).

Original entry on oeis.org

3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Crossrefs

A203415 Vandermonde determinant of the first n nonprimes (A018252).

Original entry on oeis.org

1, 3, 30, 1680, 201600, 87091200, 1103619686400, 275463473725440000, 240529195987579699200000, 1163776461866305616609280000000, 344605941225348705438623229542400000000, 3717059729911125118574880410324812431360000000000
Offset: 1

Views

Author

Clark Kimberling, Jan 01 2012

Keywords

Comments

Each term divides its successor, as in A203416, and each term is divisible by the corresponding superfactorial, A000178(n), as in A203417.

Crossrefs

Programs

  • Magma
    A018252:=[n : n in [1..250] | not IsPrime(n) ];
    A203415:= func< n | n eq 1 select 1 else (&*[(&*[A018252[k+2] - A018252[j+1]: j in [0..k]]): k in [0..n-2]]) >;
    [A203415(n): n in [1..30]]; // G. C. Greubel, Feb 29 2024
    
  • Mathematica
    z=20;
    nonprime = Join[{1}, Select[Range[250], CompositeQ]]; (* A018252 *)
    f[j_]:= nonprime[[j]];
    v[n_]:= Product[Product[f[k] - f[j], {j,1,k-1}], {k,2,n}];
    d[n_]:= Product[(i-1)!, {i,1,n}];
    Table[v[n], {n,1,z}]             (* this sequence *)
    Table[v[n+1]/v[n], {n,1,z}]      (* A203416 *)
    Table[v[n]/d[n], {n,1,z}]        (* A203417 *)
  • SageMath
    A018252=[n for n in (1..250) if not is_prime(n)]
    def A203415(n): return product(product(A018252[k+1]-A018252[j] for j in range(k+1)) for k in range(n-1))
    [A203415(n) for n in range(1,31)] # G. C. Greubel, Feb 29 2024

A245814 Permutation of natural numbers induced when A091204 is restricted to nonprime numbers: a(n) = 1+A091245(A091204(A018252(n))).

Original entry on oeis.org

1, 2, 4, 5, 3, 9, 8, 16, 6, 11, 7, 21, 22, 39, 18, 15, 29, 10, 34, 13, 24, 33, 76, 38, 14, 48, 42, 44, 46, 81, 20, 19, 37, 54, 32, 92, 60, 23, 63, 71, 25, 99, 28, 233, 30, 50, 98, 70, 157, 17, 79, 31, 89, 49, 101, 191, 86, 91, 12, 161, 94, 171, 193, 56, 167, 43, 143, 41, 353, 58, 75, 78, 113, 102, 68, 190, 125, 67, 119, 47, 130, 72, 146, 52, 27
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2014

Keywords

Crossrefs

Inverse: A245813.
Related permutations: A091204, A245816, A245819.

Programs

Formula

a(n) = 1 + A091245(A091204(A018252(n))).
As a composition of related permutations:
a(n) = A245819(A245816(n)).

A245815 Permutation of natural numbers induced when A245821 is restricted to nonprime numbers: a(n) = A062298(A245821(A018252(n))).

Original entry on oeis.org

1, 2, 5, 3, 4, 7, 9, 59, 11, 6, 20, 125, 18, 25, 15, 10, 16, 26, 32, 31, 103, 8, 12, 35, 41, 50, 13, 39, 85, 64, 43, 164, 29, 38, 17, 66, 19, 24, 21, 45, 132, 37, 105, 139, 82, 33, 65, 27, 507, 52, 14, 180, 161, 96, 46, 22, 190, 141, 87, 1603, 80, 36, 143, 107, 54, 670, 34, 47, 23, 68, 177, 1337, 40
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

This permutation is induced when A245821 is restricted to nonprimes, A018252, the first column of A114537, but equally, when it is restricted to column 2 (A007821), column 3 (A049078), etc. of that square array, or alternatively, to the successive rows of A236542.
The sequence of fixed points f(n) begins as 1, 2, 15, 142, 548, 1694, 54681. A018252(f(n)) gives the nonprime terms of A245823.

Crossrefs

Inverse: A245816.
Related permutations: A245813, A245819, A245821.

Programs

Formula

a(n) = A062298(A245821(A018252(n))).
As a composition of related permutations:
a(n) = A245813(A245819(n)).
Also following holds for all n >= 1:
Showing 1-10 of 420 results. Next