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 20 results.

A341455 Number of partitions of n into 8 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, 17, 20, 24, 28, 32, 38, 43, 51, 59, 67, 77, 90, 101, 119, 133, 152, 172, 199, 220, 256, 283, 325, 359, 412, 453, 520, 569, 652, 711, 810, 882, 1005, 1091, 1238, 1341, 1519, 1641, 1854, 1999
Offset: 8

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, 8):
    seq(a(n), n=8..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, 8];
    Table[a[n], {n, 8, 67}] (* Jean-François Alcover, Feb 23 2022, after Alois P. Heinz *)

A062305 Number of ways writing 2^n as a sum of a prime and a nonprime.

Original entry on oeis.org

0, 0, 1, 2, 2, 7, 8, 25, 38, 75, 128, 259, 458, 876, 1598, 3024, 5672, 10753, 20372, 38656, 73547, 140669, 268537, 514307, 986379, 1896755, 3650109, 7036061, 13580371, 26241380, 50765806, 98317489, 190597373, 369832498, 718266991, 1396138085, 2715823187, 5287080080
Offset: 0

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

			For n = 5: 2^5 = 32 = 31+1 = 2+30 = 5+27 = 7+25 = 11+21 = 17+15 = 23+9 so a(5) = 7.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(c = 0, m = 1 << n); forprime(p = 2, m-1, if(!isprime(m - p), c++)); c;} \\ Amiram Eldar, Jul 17 2024

Formula

a(n) = A062602(2^n) = number of prime+nonprime partitions of 2^n.
a(n) = 2^(n-1) - A006307(n) - A062306(n) for n >= 1. - Amiram Eldar, Jul 17 2024

Extensions

More terms from Dean Hickerson, Jul 23 2001
a(28)-a(32) from Sean A. Irvine, Mar 25 2023
a(33)-a(37) from Amiram Eldar, Jul 17 2024

A062306 Number of ways writing 2^n as a sum of two nonprime numbers.

Original entry on oeis.org

1, 0, 1, 4, 7, 19, 36, 82, 170, 362, 740, 1537, 3144, 6443, 13116, 26661, 54034, 109386, 221121, 446502, 900436, 1814910, 3655069, 7356483, 14796994, 29750473, 59789057, 120112121, 241218391, 484287995, 972034297, 1950544851, 3913243144, 7849331541, 15741697002
Offset: 1

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

			For n = 5: 2^5 = 32 = 4+28 = 6+26 = 8+24 = 10+22 = 12+20 = 14+18 = 16+16, so a(5) = 7.
		

Crossrefs

Formula

a(n) = A062610(2^n) = number of nonprime+nonprime partitions of 2^n.
a(n) = 2^(n-1) - A006307(n) - A062305(n). - Amiram Eldar, Jul 17 2024

Extensions

More terms from Dean Hickerson, Jul 23 2001
a(28)-a(32) from Sean A. Irvine, Mar 25 2023
a(33)-a(35) from Amiram Eldar, Jul 17 2024

A341460 Number of partitions of n into 10 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, 17, 20, 24, 28, 32, 38, 44, 51, 60, 68, 79, 92, 104, 122, 139, 157, 181, 208, 234, 270, 304, 347, 391, 445, 499, 569, 636, 724, 805, 913, 1015, 1150, 1274, 1440, 1592, 1796, 1980, 2231, 2455
Offset: 10

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, 10):
    seq(a(n), n=10..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], 0]]];
    a[n_] := b[n, n, 10];
    Table[a[n], {n, 10, 69}] (* Jean-François Alcover, Feb 28 2022, after Alois P. Heinz *)
    Table[Count[IntegerPartitions[n,{10}],?(NoneTrue[#,PrimeQ]&)],{n,10,70}] (* _Harvey P. Dale, Sep 01 2024 *)

A062303 Number of ways writing the n-th prime as a sum of two nonprimes.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 5, 6, 7, 8, 9, 9, 11, 13, 14, 15, 16, 17, 18, 19, 21, 24, 25, 26, 26, 27, 27, 33, 34, 36, 37, 40, 41, 42, 44, 45, 47, 49, 50, 53, 54, 54, 55, 59, 64, 65, 66, 66, 68, 69, 72, 74, 76, 78, 79, 80, 81, 82, 85, 91, 92, 93, 93, 99, 101, 105, 106, 106, 108
Offset: 1

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

			n=10,p(10)=29 has 14 partitions of form a+b=29; 1+28=4+25=8+21=9+20=14+15 are the 5 relevant partitions, so a(10)=5.
		

Crossrefs

Programs

  • Mathematica
    Table[c = 0; Do[If[i + j == Prime[n] && ! PrimeQ[i] && ! PrimeQ[j], c = c + 1], {i, Prime[n] - 1}, {j, i}]; c, {n, 72}] (* Jayanta Basu, Apr 22 2013 *)
    cnpQ[{a_,b_}]:=(!PrimeQ[a]&&CompositeQ[b])||(!PrimeQ[b]&&CompositeQ[a]); Join[{1},Table[Length[Select[IntegerPartitions[Prime[n],{2}],cnpQ]],{n,2,80}]] (* Harvey P. Dale, Sep 30 2018 *)

Formula

A062610(A000040(n)) = number of [nonprime+composite] partitions of p(n).

Extensions

Offset and name corrected by Sean A. Irvine, Mar 25 2023

A062310 Number of ways writing n! as a sum of two nonprime numbers.

Original entry on oeis.org

0, 1, 0, 6, 42, 271, 2029, 16880, 156002, 1594424, 17875651, 217325325, 2858334613, 40361092223, 609787506215
Offset: 1

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

			n=4, 4!=24=2+22=4+20=6+18=8+16=12+12=9+15, so a(4)=6.
		

Crossrefs

Formula

A062610(n!) = number of nonprime+nonprime partitions of n!.

Extensions

a(9)-a(15) from Donovan Johnson, Oct 05 2010

A171618 Number of ways of writing n=k1+k2 with k1 and k2 in A167707.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 3, 2, 4, 3, 3, 3, 5, 4, 6, 5, 6, 5, 7, 6, 8, 6, 8, 8, 8, 9, 9, 10, 10, 9, 11, 10, 12, 12, 13, 11, 12, 13, 13, 15, 14, 14, 15, 14, 16, 14, 17, 17, 16, 17, 17, 18, 18, 19, 18, 19, 19, 21, 21, 19, 21, 20, 22, 24, 23, 22, 22, 23, 24, 25, 25, 24, 25, 24, 27, 26, 28, 27
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 13 2009

Keywords

Examples

			a(31)=9 because 31 = 0 + 31 = 3 + 28 = 5 + 26 = 7 + 24 = 9 + 22 = 10 + 21 = 11 + 20 = 14 + 17 = 15 + 16.
		

Crossrefs

Programs

  • Maple
    isA001097 := proc(n) isprime(n) and (isprime(n+2) or isprime(n-2)) ; end proc:
    isA164276 := proc(n) not isprime(n) and ( not isprime(n+1) or not isprime(n-1) ) ; end proc: isA167707 := proc(n) isA001097(n) or isA164276(n) ; end proc:
    A167707 := proc(n) option remember; if n = 1 then 0; else for a from procname(n-1)+1 do if isA167707(a) then return a; end if; end do; end if; end proc:
    A171618 := proc(n) a := 0 ; for i from 1 do p := A167707(i) ; q := n-p ; if q < p then return a ; end if; if isA167707(q) then a := a+1 ; end if; if q <= p then return a ; end if; end do: end proc:
    seq(A171618(n),n=1..120) ; # R. J. Mathar, May 22 2010
  • Mathematica
    isA001097[n_] := PrimeQ[n] && (PrimeQ[n+2] || PrimeQ[n-2]);
    isA164276[n_] := !PrimeQ[n] && (!PrimeQ[n+1] ||!PrimeQ[n-1]);
    isA167707[n_] := isA001097[n] || isA164276[n];
    A167707[n_] := A167707[n] = If[n == 1, 0, For[a = A167707[n-1]+1, True, a++, If[isA167707[a], Return@a]]];
    A171618[n_] := Module[{a}, a = 0; For[i = 1, True, i++, p = A167707[i]; q = n-p; If[q < p, Return@a]; If[isA167707[q], a++]; If[q <= p, Return@a]]];
    Table[A171618[n], {n, 1, 120}] (* Jean-François Alcover, Feb 23 2024, after R. J. Mathar *)

Extensions

a(29) and a(34) corrected and sequence extended by R. J. Mathar, May 22 2010

A171691 Number of unordered partitions {k1, k2} of n such that k1 and k2 are nonnegative nonprimes A141468.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Dec 15 2009

Keywords

Examples

			a(1) = 1 because 1 = 0 + 1.
a(2) = 1 because 2 = 1 + 1.
a(3) = 0.
a(4) = 1 because 4 = 0 + 4.
a(5) = 1 because 5 = 1 + 4.
a(6) = 1 because 6 = 0 + 6.
a(7) = 1 because 7 = 1 + 6.
a(8) = 2 because 8 = 0 + 8 = 4 + 4.
		

Crossrefs

Programs

  • PARI
    a(n)={sum(i=0, n\2, (i<2 || !isprime(i)) && !isprime(n-i))} \\ Andrew Howroyd, Jan 05 2020

Extensions

Name clarified and terms a(55) and beyond from Andrew Howroyd, Jan 05 2020

A334207 Number of ways to write 2n as the sum of two nonprime positive integers.

Original entry on oeis.org

1, 0, 0, 1, 2, 2, 2, 4, 4, 4, 5, 6, 6, 7, 8, 7, 9, 11, 8, 11, 12, 11, 12, 14, 14, 14, 16, 15, 16, 19, 15, 19, 21, 17, 21, 22, 20, 22, 25, 22, 23, 27, 24, 25, 30, 26, 27, 31, 27, 31, 33, 30, 31, 34, 32, 34, 37, 34, 34, 42, 34, 37, 43, 36, 41, 43, 40, 41, 44, 43
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 18 2020

Keywords

Examples

			a(8) = 4; 2*8 = 16 has four partitions into nonprime parts, (15,1), (12,4), (10,6) and (8,8).
		

Crossrefs

Cf. A010051.
Bisection of A062610.

Programs

  • Maple
    N:= 1000: # for a(1)..a(N)
    NP:= remove(isprime, [$1..2*N]):
    V:= Vector(N):
    for i from 1 to nops(NP) do
      for j from i do
        x:= NP[i]+NP[j];
        if x > 2*N then break fi;
        if x::even then
          V[x/2]:= V[x/2]+1;
        fi
    od od:
    convert(V,list); # Robert Israel, Apr 20 2020
  • Mathematica
    Table[Sum[(1 - PrimePi[i] + PrimePi[i - 1]) (1 - PrimePi[2 n - i] + PrimePi[2 n - i - 1]), {i, n}], {n, 100}]

Formula

a(n) = Sum_{i=1..n} (1 - c(i)) * (1 - c(2*n - i)), where c is the prime characteristic (A010051).

A345039 Number of partitions of n into two composite parts that share a nontrivial divisor.

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Jun 06 2021

Keywords

Examples

			a(12) = 2; (8,4) and (6,6).
a(15) = 1; (9,6).
a(16) = 3; (12,4), (10,6), and (8,8).
a(18) = 4; (14,4), (12,6), (10,8), and (9,9).
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(1 - PrimePi[k] + PrimePi[k - 1]) (1 - PrimePi[n - k] + PrimePi[n - k - 1]) (1 - Floor[1/GCD[k, n - k]]), {k, Floor[n/2]}], {n, 100}]

Formula

a(n) = Sum_{k=1..floor(n/2)} (1 - floor(1/gcd(k,n-k))) * c(k) * c(n-k), where c(n) is the characteristic function of composite numbers.
Previous Showing 11-20 of 20 results.