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.

Showing 1-2 of 2 results.

A225567 Primes with nonzero digits such that sum of cubes of digits equal to square of sums.

Original entry on oeis.org

1423, 2143, 2341, 4231, 12253, 21523, 22153, 22531, 23251, 25321, 32251, 35221, 36343, 36433, 43633, 52321, 64333, 114451, 144511, 224461, 244261, 246241, 365557, 415141, 424261, 426421, 446221, 446461, 451411, 462421, 466441, 541141, 555637, 556537, 556573
Offset: 1

Views

Author

Balarka Sen, Jul 26 2013

Keywords

Comments

Largest term of this sequence is the 20-digit prime 99151111111111111111.
The Pagni article mentioned below has no bearing on this problem because it deals with the well-known identity sum_{i=1..n} i^3 = (sum_{i=1..n} i)^2. However, the article is interesting. - T. D. Noe, Jul 26 2013
This sequence has exactly 14068465 provable primes. This result required about one hour of Mathematica on fairly fast computer having 16 GB of memory. - T. D. Noe, Jul 30 2013

Examples

			a(5) = 12253 since 1^3 + 2^3 + 2^3 + 5^3 + 3^3 = (1 + 2 + 2 + 5 + 3)^2.
		

Crossrefs

Cf. A055012 (sum of cubes of digits), A118881 (square of sum of the digits).

Programs

  • Mathematica
    (* let tz[[i]] be numbers computed in A227073 *) Select[tz, PrimeQ] (* T. D. Noe, Jul 30 2013 *)
    pQ[n_]:=Module[{idn=IntegerDigits[n]},FreeQ[idn,0]&&Total[idn^3] == Total[ idn]^2]; Select[Prime[Range[50000]],pQ] (* Harvey P. Dale, Sep 17 2013 *)
  • PARI
    forprime(n=1, 10^7, v=digits(n); if(sum(i=1, length(v), v[i]^3)==sum(i=1, length(v), v[i])^2 & setsearch(Set(v),0)!=1, print1(n", ")))

Extensions

Corrected by T. D. Noe, Jul 26 2013

A227072 Positive numbers with nondecreasing digits such that sum of cubes of the digits equals the square of the sum of the digits.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Jul 27 2013

Keywords

Comments

Because the digits are nondecreasing, the search to 10^20 is fairly rapid.

Examples

			1234 is here because 1^3 + 2^3 + 3^3 + 4^3 = (1 + 2 + 3 + 4)^2 and its digits are nondecreasing..
		

Crossrefs

Cf. A225567 (primes in a related sequence), A227073.

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 *)
Showing 1-2 of 2 results.