login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A337854 a(n) is the smallest number that can be partitioned in exactly n ways as the sum of two Niven numbers. 2

%I #14 Sep 08 2022 08:46:25

%S 0,2,4,6,8,10,51,48,72,108,126,90,138,144,120,198,162,210,216,315,240,

%T 234,306,252,372,270,546,360,342,444,414,468,420,642,450,522,540,924,

%U 612,600,666,630,888,930,756,840,882,936,972,1098,1215,1026,1212,1080

%N a(n) is the smallest number that can be partitioned in exactly n ways as the sum of two Niven numbers.

%e a(0) = 0 because 0 cannot be written as the sum of two Niven numbers.

%e a(1) = 2 because 2 is uniquely written 2 = 1 + 1, with 1 in A005349.

%e a(2) = 4 because 4 = 1 + 3 = 2 + 2 and 1, 2, 3 are in A005349.

%e a(3) = 6 because 6 = 1 + 5 = 2 + 4 = 3 + 3 and 1, 2, 3, 4, 5 are terms in A005349.

%e 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.

%t 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 *)

%o (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;

%Y Cf. A005349, A337853.

%K nonn,base

%O 0,2

%A _Marius A. Burtea_, Sep 26 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 04:24 EDT 2024. Contains 372205 sequences. (Running on oeis4.)