OFFSET
0,6
LINKS
Eric Weisstein's World of Mathematics, Ulam Sequence
Wikipedia, Ulam number
EXAMPLE
The first terms of A001857 are 2, 3, 5, 7, 8, 9, 13, 14, 18, 19, ...
a(10) = #{8+2, 7+3, 5+5, 5+3+2, 3+3+2+2, 2+2+2+2+2} = 6;
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;
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.
MATHEMATICA
nmax = 60;
U = {2, 3};
Do[AppendTo[U, k = Last[U]; While[k++; Length[DeleteCases[Intersection[U, k - U], k/2, 1, 1]] != 2]; k], {nmax}];
a[n_] := IntegerPartitions[n, All, Select[U, # <= n &]] // Length;
Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Oct 12 2021 *)
PROG
(Haskell)
a199122 = p a001857_list where
p _ 0 = 1
p us'@(u:us) m | m < u = 0
| otherwise = p us' (m - u) + p us m
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Nov 03 2011
STATUS
approved