A227072 Positive numbers with nondecreasing digits such that sum of cubes of the digits equals the square of the sum of the digits.
1, 12, 22, 123, 333, 1224, 1234, 2244, 4444, 12235, 12345, 33336, 33346, 55555, 111225, 111445, 112455, 114555, 122346, 122446, 123456, 144466, 222226, 224466, 244557, 244666, 333357, 333666, 345567, 355567, 455667, 666666, 1122556, 1134457, 1145557, 1155666
Offset: 1
Examples
1234 is here because 1^3 + 2^3 + 3^3 + 4^3 = (1 + 2 + 3 + 4)^2 and its digits are nondecreasing..
Links
- T. D. Noe, Table of n, a(n) for n = 1..660
Programs
-
Mathematica
(* complete sequence *) tx = {}; Do[d = {i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20}; If[Total[d^3] == Total[d]^2, n = FromDigits[d]; AppendTo[tx, n]], {i1, 0, 9}, {i2, i1, 9}, {i3, i2, 9}, {i4, i3, 9}, {i5, i4, 9}, {i6, i5, 9}, {i7, i6, 9}, {i8, i7, 9}, {i9, i8, 9}, {i10, i9, 9}, {i11, i10, 9}, {i12, i11, 9}, {i13, i12, 9}, {i14, i13, 9}, {i15, i14, 9}, {i16, i15, 9}, {i17, i16, 9}, {i18, i17, 9}, {i19, i18, 9}, {i20, i19, 9}]; tx = Rest[tx] (* partial sequence *) nddQ[n_] := Module[{idn=IntegerDigits[n]}, Min[Differences[idn]] >= 0 && Total[idn^3] == Total[idn]^2]; Select[Range[2000000], nddQ] (* Harvey P. Dale, Sep 01 2013 *)
Comments