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.

Previous Showing 11-20 of 86 results. Next

A062602 Number of ways of writing n = p+c with p prime and c nonprime (1 or a composite number).

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 1, 2, 2, 1, 4, 3, 3, 3, 4, 2, 6, 3, 5, 4, 6, 3, 8, 3, 7, 4, 9, 5, 9, 4, 8, 7, 9, 4, 11, 3, 11, 9, 10, 6, 12, 5, 11, 8, 12, 7, 14, 5, 13, 7, 15, 9, 15, 6, 14, 10, 16, 9, 16, 5, 15, 13, 16, 8, 18, 6, 18, 15, 17, 9, 19, 8, 18, 12, 19, 11, 21, 7, 21, 14, 20, 13, 22, 7, 21, 14
Offset: 1

Views

Author

Labos Elemer, Jul 04 2001

Keywords

Examples

			n = 22 has floor(n/2) = 11 partitions of form n = a + b; 3 partitions are of prime + prime [3 + 19 = 5 + 17 = 11 + 11], 3 partitions are of prime + nonprime [2 + 20 = 7 + 15 = 13 + 9], 5 partitions are nonprime + nonprime [1 + 21 = 4 + 18 = 6 + 16 = 8 + 14 = 10 + 12]. So a(22) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[Floor[n/2]], (PrimeQ[#] && Not[PrimeQ[n - #]]) || (Not[PrimeQ[#]] && PrimeQ[n - #]) &]], {n, 80}] (* Alonso del Arte, Apr 21 2013 *)
    Table[Length[Select[IntegerPartitions[n,{2}],AnyTrue[#,PrimeQ] && !AllTrue[ #,PrimeQ]&]],{n,90}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 19 2020 *)

Formula

a(n+1) = SUM(A010051(k)*A005171(n-k+1): 1<=k<=n). [From Reinhard Zumkeller, Nov 05 2009]
a(n) + A061358(n) + A062610(n) = A004526(n). - R. J. Mathar, Sep 10 2021

A014684 In the sequence of positive integers subtract 1 from each prime number.

Original entry on oeis.org

1, 1, 2, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 22, 24, 25, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 46, 48, 49, 50, 51, 52, 52, 54, 55, 56, 57, 58, 58, 60, 60, 62, 63, 64, 65, 66, 66, 68, 69, 70, 70, 72
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a014684 n = n - fromIntegral (a010051 n)
    -- Reinhard Zumkeller, Sep 10 2013
    
  • Magma
    [n - (IsPrime(n) select 1 else 0): n in [1..80]]; // Bruno Berselli, Jul 18 2016
    
  • Mathematica
    Table[If[PrimeQ[n],n-1,n],{n,100}] (* Harvey P. Dale, Aug 27 2015 *)
  • Python
    from sympy import isprime
    def A014684(n): return n-int(isprime(n)) # Chai Wah Wu, Oct 14 2023

Formula

a(n) = A005171(n) + n - 1.
a(n) = phi(n!)/phi((n-1)!). - Vladeta Jovovic, Nov 30 2002
For n > 3: a(n) = A113523(n) = A179278(n). - Reinhard Zumkeller, Jul 08 2010
a(n) = n - A010051(n). - Reinhard Zumkeller, Sep 10 2013

Extensions

More terms from Andrew J. Gacek (andrew(AT)dgi.net)

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

A302479 Number of partitions of n into two distinct nonprime parts.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 1, 2, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 5, 3, 5, 4, 6, 4, 6, 5, 7, 6, 6, 6, 9, 6, 10, 7, 8, 8, 10, 8, 11, 9, 10, 9, 12, 9, 13, 10, 13, 10, 13, 11, 15, 12, 14, 12, 16, 13, 18, 14, 15, 14, 18, 14, 20, 15, 16, 16, 20, 16, 21, 17, 20, 17
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 08 2018

Keywords

Examples

			a(16) = 3; 16 = 15+1 = 12+4 = 10+6, which are distinct nonprimes.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(1 - PrimePi[n - i] + PrimePi[n - i - 1]) (1 - PrimePi[i] + PrimePi[i - 1]), {i, Floor[(n - 1)/2]}], {n, 100}]
    Table[Length[Select[IntegerPartitions[n,{2}],Length[Union[#]]==2&&Boole[PrimeQ[#]]=={0,0}&]],{n,80}] (* Harvey P. Dale, Dec 28 2023 *)
  • PARI
    A302479(n) = sum(k=1,(n-1)\2,!(isprime(k)+isprime(n-k))); \\ Antti Karttunen, Nov 25 2022

Formula

a(n) = Sum_{i=1..floor((n-1)/2)} (1 - c(i)) * (1 - c(n-i)), where c = A010051.
For n > 0, a(n) = A358638(n) - A005171(n). - Antti Karttunen, Nov 25 2022

A341461 Number of partitions of n into 3 distinct nonprime parts.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 2, 2, 4, 3, 4, 4, 6, 5, 8, 7, 9, 9, 10, 12, 14, 14, 14, 17, 19, 19, 22, 23, 24, 28, 27, 31, 33, 35, 36, 40, 40, 44, 47, 49, 50, 55, 53, 61, 62, 66, 65, 73, 72, 79, 81, 86, 85, 95, 91, 101, 101, 109, 107, 119, 114, 125, 125, 134, 134
Offset: 11

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i-1), t-1))))
        end:
    a:= n-> b(n$2, 3):
    seq(a(n), n=11..75);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1]]]];
    a[n_] := b[n, n, 3];
    a /@ Range[11, 75] (* Jean-François Alcover, Jul 01 2021, after Alois P. Heinz *)
  • Python
    from functools import lru_cache
    from sympy import isprime
    @lru_cache(maxsize=None)
    def b(n, i, t):
      if n == 0: return int(t == 0)
      if i < 1 or t < 1: return 0
      b2 = 0 if isprime(i) else b(n-i, min(n-i, i-1), t-1)
      return b(n, i-1, t) + b2
    a = lambda n: b(n, n, 3)
    print([a(n) for n in range(11, 76)]) # Michael S. Branicky, Feb 12 2021 after Alois P. Heinz

A060476 Let n = 2^e_2 * 3^e_3 * 5^e_5 * ... be the prime factorization of n; sequence gives n such that 1 + max{e_2, e_3, ...} is nonprime.

Original entry on oeis.org

1, 8, 24, 27, 32, 40, 54, 56, 72, 88, 96, 104, 108, 120, 125, 128, 135, 136, 152, 160, 168, 184, 189, 200, 216, 224, 232, 243, 248, 250, 256, 264, 270, 280, 288, 296, 297, 312, 328, 343, 344, 351, 352, 360, 375, 376, 378, 384, 392, 408, 416, 424, 440, 456, 459, 472, 480
Offset: 1

Views

Author

N. J. A. Sloane, Sep 18 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A005171.
The asymptotic density of this sequence is Sum_{c composite} (1/zeta(c) - 1/zeta(c-1)) = 0.1182437806... - Amiram Eldar, Oct 18 2020

Crossrefs

Programs

  • Haskell
    a060476 n = a060476_list !! (n-1)
    a060476_list = filter ((== 0) . a010051' . (+ 1) . a051903) [1..]
    -- Reinhard Zumkeller, Nov 30 2015
  • Mathematica
    Join[{1}, Select[Range[500], !PrimeQ[1+Max[FactorInteger[#][[All, 2]]]]&]] (* Jean-François Alcover, Aug 02 2018 *)
  • PARI
    isA060476(n) = if(n<2,1,!isprime(vecmax(factor(n)[,2])+1))
    

Formula

From Reinhard Zumkeller, Nov 30 2015: (Start)
A010051(A051903(a(n)+1)) = 1.
a(A055229(n)) > 1 for n > 1. (End)

A076608 Number of nonprimes k < n such that also n-k is not a prime.

Original entry on oeis.org

0, 1, 0, 0, 2, 0, 2, 1, 2, 4, 2, 3, 4, 4, 4, 7, 4, 7, 6, 7, 6, 10, 6, 11, 8, 12, 8, 13, 10, 15, 12, 13, 12, 18, 12, 21, 14, 16, 16, 21, 16, 23, 18, 21, 18, 24, 18, 27, 20, 27, 20, 27, 22, 31, 24, 29, 24, 32, 26, 37, 28, 30, 28, 37, 28, 41, 30, 33, 32, 41, 32, 43, 34, 40, 34, 43, 34
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 21 2002

Keywords

Comments

a(n) is odd iff n is even and n/2 is not prime.
Convolution of A005171 with itself. - R. J. Mathar, Sep 10 2021

Examples

			5=1+4=2+3=3+2=4+1, hence a(5)=2;
6=1+5=2+4=3+3=4+2=5+1, hence a(6)=0.
		

Crossrefs

Programs

  • Mathematica
    Table[With[{nn=m},Total[Table[If[NoneTrue[{n,nn-n},PrimeQ],1,0],{n,nn-1}]]],{m,80}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 15 2020 *)

A341451 Number of partitions of n into 4 nonprime parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 6, 5, 7, 8, 9, 10, 13, 13, 17, 17, 22, 21, 27, 27, 34, 34, 41, 40, 51, 49, 62, 59, 71, 70, 86, 82, 101, 97, 117, 112, 135, 131, 155, 150, 180, 170, 202, 196, 228, 222, 259, 248, 291, 281, 324, 314, 361, 348, 404, 388, 445, 431
Offset: 4

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i), t-1))))
        end:
    a:= n-> b(n$2, 4):
    seq(a(n), n=4..69);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i], t - 1]]]];
    a[n_] := b[n, n, 4];
    Table[a[n], {n, 4, 69}] (* Jean-François Alcover, Aug 19 2021, after Alois P. Heinz *)

A341452 Number of partitions of n into 5 nonprime parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 6, 6, 7, 9, 9, 12, 14, 16, 18, 22, 24, 29, 31, 38, 40, 49, 50, 62, 65, 77, 81, 97, 98, 120, 122, 144, 149, 176, 178, 212, 214, 251, 255, 299, 304, 352, 355, 412, 417, 482, 485, 559, 564, 643, 650, 742, 745, 850, 856, 965
Offset: 5

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i), t-1))))
        end:
    a:= n-> b(n$2, 5):
    seq(a(n), n=5..68);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i], t - 1]]]];
    a[n_] := b[n, n, 5];
    Table[a[n], {n, 5, 68}] (* Jean-François Alcover, Aug 19 2021, after Alois P. Heinz *)

A341453 Number of partitions of n into 6 nonprime parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 6, 6, 7, 9, 10, 12, 15, 16, 20, 23, 27, 30, 36, 40, 48, 53, 62, 68, 81, 87, 105, 112, 130, 141, 166, 176, 208, 219, 256, 271, 314, 331, 385, 403, 468, 488, 561, 588, 674, 702, 804, 837, 952, 991, 1126, 1168, 1321, 1372
Offset: 6

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i), t-1))))
        end:
    a:= n-> b(n$2, 6):
    seq(a(n), n=6..67);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i], t - 1], 0]]];
    a[n_] := b[n, n, 6];
    Table[a[n], {n, 6, 67}] (* Jean-François Alcover, Feb 23 2022, after Alois P. Heinz *)
    Table[Count[IntegerPartitions[n,{6}],?(NoneTrue[#,PrimeQ]&)],{n,6,70}] (* _Harvey P. Dale, Feb 21 2023 *)
Previous Showing 11-20 of 86 results. Next