login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Primes p such that p + d and p-d are primes, where d is the sum of floors of square roots of the digits of p.
1

%I #8 Apr 14 2020 12:11:41

%S 5,593,647,1097,1187,1367,1453,1663,1753,1783,1873,1907,2287,2377,

%T 2417,2683,3463,3637,3923,4513,5413,5807,6263,6317,6373,7523,7823,

%U 8087,8117,8237,8713,10853,11807,11833,11903,15313,15803,16063,16223,17027,18223

%N Primes p such that p + d and p-d are primes, where d is the sum of floors of square roots of the digits of p.

%H Robert Israel, <a href="/A179634/b179634.txt">Table of n, a(n) for n = 1..2000</a>

%e a(3)=647 since 647+[int(sqrt(6))+int(sqrt(4))+int(sqrt(7))]=647+(2+2+2)=647+6=653 is prime AND 647-6=641 is prime.

%p filter:= proc(p) local L,t,d;

%p if not isprime(p) then return false fi;

%p L:= convert(p,base,10);

%p d:= add(floor(sqrt(t)),t=L);

%p isprime(p-d) and isprime(p+d)

%p end proc:

%p select(filter, [seq(i,i=3..20000,2)]); # _Robert Israel_, Apr 14 2020

%o (PARI) isok(p) = isprime(p) && (d=digits(p)) && (sd = sum(i=1, #d, sqrtint(d[i]))) && isprime(p+sd) && isprime(p-sd); \\ _Michel Marcus_, Jan 19 2014

%K nonn,base

%O 1,1

%A _Carmine Suriano_, Jul 21 2010

%E Definition clarified by _Robert Israel_, Apr 14 2020