login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A245064 Primes p such that p minus its digit sum is a perfect cube. 2

%I #30 Jul 18 2014 08:29:47

%S 2,3,5,7,31,37,223,227,229,743,1741,1747,3391,5851,5857,9281,9283,

%T 13841,19709,27011,27017,35963,35969,46681,46687,59341,74101,91141,

%U 110603,110609,132679,373273,474581,474583,729023,804383,1061227,1259743,1259749,1481573,2000393

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

%H K. D. Bajpai and Jens Kruse Andersen, <a href="/A245064/b245064.txt">Table of n, a(n) for n = 1..10000</a> (first 274 terms from K. D. Bajpai)

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

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

%p dmax:= 9; # to get all entries < 10^dmax

%p cmax:= floor(10^(dmax/3));

%p count:= 0;

%p for m from 0 to cmax do

%p for p from m^3 to m^3 + 9*dmax do

%p if p - convert(convert(p,base,10),`+`) = m^3 and isprime(p) then

%p count:= count+1;

%p A[count]:= p;

%p fi

%p od

%p od;

%p {seq(A[i],i=1..count)}; # _Robert Israel_, Jul 15 2014

%t Select[Prime[Range[200000]], IntegerQ[CubeRoot[# - Apply[Plus, IntegerDigits[#]]]] &]

%o (PARI)

%o digsum(n) = my(d=eval(Vec(Str(n)))); sum(i=1, #d, d[i])

%o s=[]; forprime(p=2, 2002000, if(ispower(p-digsum(p), 3), s=concat(s, p))); s \\ _Colin Barker_, Jul 15 2014

%Y Cf. A000578, A048519, A107288.

%K nonn,base

%O 1,1

%A _K. D. Bajpai_, Jul 11 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)