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.

A165551 Sum of cube of digits is sum of digits of cube.

Original entry on oeis.org

0, 1, 2, 10, 20, 31, 100, 103, 123, 200, 203, 301, 302, 310, 1000, 1003, 1030, 1230, 1302, 1312, 1321, 2000, 2003, 2030, 2312, 3001, 3002, 3010, 3020, 3032, 3100, 3112, 3211, 3213, 3221, 10000, 10003, 10030, 10033, 10232, 10300, 10303, 11223, 12033
Offset: 0

Views

Author

Rémy Sigrist, Sep 21 2009

Keywords

Examples

			For n=31, n^3=29791, sum of digits of cube is 2+9+7+9+1=28, sum of cube of digits is 3^3+1=27+1=28, thus 31 appears in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,13000],Total[IntegerDigits[#^3]]==Total[IntegerDigits[ #]^3]&] (* Harvey P. Dale, Nov 13 2011 *)
  • PARI
    cubdigsum(n) = local(s=0);while(n,s=s+(n%10)^3;n=n\10);return(s)
    for(n=0,100000, if(cubdigsum(n)==sumdigits(n^3), print1(n, ",") ) )

A290972 Primes p such that the sum of the squares of digits of p equals the sum of digits of p^2.

Original entry on oeis.org

2, 3, 3331, 3433, 11243, 13241, 21523, 22153, 22531, 31541, 32141, 32411, 33203, 34033, 34141, 34211, 35141, 41341, 41413, 42131, 43411, 44131, 51341, 51413, 52321, 54311, 102253, 102523, 104231, 104513, 110543, 111263, 111623, 112163
Offset: 1

Views

Author

K. D. Bajpai, Aug 16 2017

Keywords

Comments

214007 is the smallest term that is in A017353 and 31111009 is the smallest term that is in A017377. - Altug Alkan, Aug 16 2017

Examples

			a(3) = 3331 is prime: [3^2 + 3^2 + 3^2 + 1^2 = 9 + 9 + 9 + 1] = 28; [3331^2 = 11095561, 1 + 1 + 0 + 9 + 5 + 5 + 1] = 28.
a(5) = 11243 is prime: [1^2 + 1^2 + 2^2 + 4^2 + 3^2 = 1 + 1 + 4 + 16 + 9] = 31: [11243^2 = 126405049;1 + 2 + 6 + 4 + 0 + 5 + 0 + 4 + 9] = 31.
		

Crossrefs

Intersection of A000040 and A165550.
Cf. A123157.

Programs

  • Maple
    filter:= t -> convert(map(`^`,convert(t,base,10),2),`+`) = convert(convert(t^2,base,10),`+`) and isprime(t):
    select(filter, [2,seq(i,i=3..200000,2)]); # Robert Israel, Aug 16 2017
  • Mathematica
    Select[Prime[Range[20000]], Plus @@ IntegerDigits[#^2] == Total[IntegerDigits[#]^2] &]
  • PARI
    forprime(p=1, 30000, v=digits(p); if(sum(i=1, length(v), v[i]^2) == sumdigits(p^2), print1(p", ")));
Showing 1-2 of 2 results.