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.

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

This page as a plain text file.
%I A337854 #14 Sep 08 2022 08:46:25
%S A337854 0,2,4,6,8,10,51,48,72,108,126,90,138,144,120,198,162,210,216,315,240,
%T A337854 234,306,252,372,270,546,360,342,444,414,468,420,642,450,522,540,924,
%U A337854 612,600,666,630,888,930,756,840,882,936,972,1098,1215,1026,1212,1080
%N A337854 a(n) is the smallest number that can be partitioned in exactly n ways as the sum of two Niven numbers.
%e A337854 a(0) = 0 because 0 cannot be written as the sum of two Niven numbers.
%e A337854 a(1) = 2 because 2 is uniquely written 2 = 1 + 1, with 1 in A005349.
%e A337854 a(2) = 4 because 4 = 1 + 3 = 2 + 2 and 1, 2, 3 are in A005349.
%e A337854 a(3) = 6 because 6 = 1 + 5 = 2 + 4 = 3 + 3 and 1, 2, 3, 4, 5 are terms in A005349.
%e A337854 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 A337854 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 A337854 (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 A337854 Cf. A005349, A337853.
%K A337854 nonn,base
%O A337854 0,2
%A A337854 _Marius A. Burtea_, Sep 26 2020