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.

A245064 Primes p such that p minus its digit sum is a perfect cube.

Original entry on oeis.org

2, 3, 5, 7, 31, 37, 223, 227, 229, 743, 1741, 1747, 3391, 5851, 5857, 9281, 9283, 13841, 19709, 27011, 27017, 35963, 35969, 46681, 46687, 59341, 74101, 91141, 110603, 110609, 132679, 373273, 474581, 474583, 729023, 804383, 1061227, 1259743, 1259749, 1481573, 2000393
Offset: 1

Views

Author

K. D. Bajpai, Jul 11 2014

Keywords

Examples

			37 is in the sequence because it is prime. Also, 37 - (3 + 7 ) = 27 = 3^3: a perfect cube.
743 is in the sequence because it is prime. Also, 743 - (7 + 4 + 3) = 729 = 9^3: a perfect cube.
		

Crossrefs

Programs

  • Maple
    dmax:= 9; # to get all entries < 10^dmax
    cmax:= floor(10^(dmax/3));
    count:= 0;
    for m from 0 to cmax do
       for p from m^3 to m^3 + 9*dmax do
          if p - convert(convert(p,base,10),`+`) = m^3 and isprime(p) then
             count:= count+1;
             A[count]:= p;
          fi
       od
    od;
    {seq(A[i],i=1..count)}; # Robert Israel, Jul 15 2014
  • Mathematica
    Select[Prime[Range[200000]], IntegerQ[CubeRoot[# - Apply[Plus, IntegerDigits[#]]]] &]
  • PARI
    digsum(n) = my(d=eval(Vec(Str(n)))); sum(i=1, #d, d[i])
    s=[]; forprime(p=2, 2002000, if(ispower(p-digsum(p), 3), s=concat(s, p))); s \\ Colin Barker, Jul 15 2014