OFFSET
0,2
EXAMPLE
a(0) = 0 because 0 cannot be written as the sum of two Niven numbers.
a(1) = 2 because 2 is uniquely written 2 = 1 + 1, with 1 in A005349.
a(2) = 4 because 4 = 1 + 3 = 2 + 2 and 1, 2, 3 are in A005349.
a(3) = 6 because 6 = 1 + 5 = 2 + 4 = 3 + 3 and 1, 2, 3, 4, 5 are terms in A005349.
a(6) = 51, because 51 = 1 + 50 = 3 + 48 = 6 + 45 = 9 + 42 = 21 + 30 = 24 + 27 and 1, 3, 6, 9, 21, 24, 27, 30, 42, 45, 48, 50 are terms in A005349.
MATHEMATICA
m = 1300; nivens = Select[Range[m], Divisible[#, Plus @@ IntegerDigits[#]] &]; a[n_] := Length[IntegerPartitions[n, {2}, nivens]]; mx = 54; s = Table[-1, {mx}]; c = 0; n = 0; While[c < mx, i = a[n] + 1; If[i <= mx && s[[i]] < 0, c++; s[[i]] = n]; n++]; s (* Amiram Eldar, Sep 27 2020 *)
PROG
(Magma) a:=[]; niven:=func<n|n mod &+Intseq(n) eq 0 >; for n in [0..55] do k:=0; while k le 10000 and #RestrictedPartitions(k, 2, {m:m in [1..k-1]| niven(m)}) ne n do k:=k+1; end while; Append(~a, k); end for; a;
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marius A. Burtea, Sep 26 2020
STATUS
approved