login
Number of partitions of n into terms of (2,3)-Ulam sequence, cf. A001857.
6

%I #9 Oct 12 2021 16:02:53

%S 1,0,1,1,1,2,2,3,4,5,6,7,9,11,14,16,20,23,29,33,39,47,54,64,75,86,101,

%T 117,135,155,179,204,236,268,306,349,397,450,511,577,653,736,831,934,

%U 1050,1179,1322,1478,1657,1848,2065,2302,2562,2852,3172,3518,3909

%N Number of partitions of n into terms of (2,3)-Ulam sequence, cf. A001857.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/UlamSequence.html">Ulam Sequence</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Ulam_number">Ulam number</a>

%H <a href="/index/U#Ulam_num">Index entries for Ulam numbers</a>

%e The first terms of A001857 are 2, 3, 5, 7, 8, 9, 13, 14, 18, 19, ...

%e a(10) = #{8+2, 7+3, 5+5, 5+3+2, 3+3+2+2, 2+2+2+2+2} = 6;

%e a(11) = #{9+2, 8+3, 7+2+2, 5+3+3, 5+2+2+2, 3+3+3+2, 3+2+2+2+2} = 7;

%e a(12) = #{9+3, 8+2+2, 7+5, 7+3+2, 5+5+2, 5+3+2+2, 3+3+3+3, 3+3+2+2+2, 6x2} = 9.

%t nmax = 60;

%t U = {2, 3};

%t Do[AppendTo[U, k = Last[U]; While[k++; Length[DeleteCases[Intersection[U, k - U], k/2, 1, 1]] != 2]; k], {nmax}];

%t a[n_] := IntegerPartitions[n, All, Select[U, # <= n &]] // Length;

%t Table[a[n], {n, 0, nmax}] (* _Jean-François Alcover_, Oct 12 2021 *)

%o (Haskell)

%o a199122 = p a001857_list where

%o p _ 0 = 1

%o p us'@(u:us) m | m < u = 0

%o | otherwise = p us' (m - u) + p us m

%Y Cf. A000607; A199123, A199016, A199118, A199120.

%K nonn

%O 0,6

%A _Reinhard Zumkeller_, Nov 03 2011