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.

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

This page as a plain text file.
%I A341461 #14 Jul 01 2021 07:16:08
%S A341461 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,
%T A341461 28,27,31,33,35,36,40,40,44,47,49,50,55,53,61,62,66,65,73,72,79,81,86,
%U A341461 85,95,91,101,101,109,107,119,114,125,125,134,134
%N A341461 Number of partitions of n into 3 distinct nonprime parts.
%H A341461 Alois P. Heinz, <a href="/A341461/b341461.txt">Table of n, a(n) for n = 11..10000</a>
%p A341461 b:= proc(n, i, t) option remember; `if`(n=0,
%p A341461       `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
%p A341461       `if`(isprime(i), 0, b(n-i, min(n-i, i-1), t-1))))
%p A341461     end:
%p A341461 a:= n-> b(n$2, 3):
%p A341461 seq(a(n), n=11..75);  # _Alois P. Heinz_, Feb 12 2021
%t A341461 b[n_, i_, t_] := b[n, i, t] = If[n == 0,
%t A341461      If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
%t A341461      If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1]]]];
%t A341461 a[n_] := b[n, n, 3];
%t A341461 a /@ Range[11, 75] (* _Jean-François Alcover_, Jul 01 2021, after _Alois P. Heinz_ *)
%o A341461 (Python)
%o A341461 from functools import lru_cache
%o A341461 from sympy import isprime
%o A341461 @lru_cache(maxsize=None)
%o A341461 def b(n, i, t):
%o A341461   if n == 0: return int(t == 0)
%o A341461   if i < 1 or t < 1: return 0
%o A341461   b2 = 0 if isprime(i) else b(n-i, min(n-i, i-1), t-1)
%o A341461   return b(n, i-1, t) + b2
%o A341461 a = lambda n: b(n, n, 3)
%o A341461 print([a(n) for n in range(11, 76)]) # _Michael S. Branicky_, Feb 12 2021 after _Alois P. Heinz_
%Y A341461 Cf. A005171, A018252, A096258, A125688, A302479, A341408, A341462, A341464, A341465, A341466, A341467.
%K A341461 nonn
%O A341461 11,5
%A A341461 _Ilya Gutkovskiy_, Feb 12 2021