OFFSET
1,1
COMMENTS
Frankel named "S(um)anD(ifference) number" any n such that the sum of digits of n(n+d) equals d, for some d. SanD primes are SanD numbers p such that p and p+d are prime. For given d, we will refer to SanD-d numbers or primes.
The only prime solution with odd d is p = 2, d = 5.
All other SanD primes must have d == 14 (mod 18).
This is the list of all SanD primes, i.e., the union of the SanD-5 prime 2, the SanD-14 primes A307471, SanD-32 primes A307472, SanD-50 primes A307473, etc.
Sequence A307480 lists the smallest SanD-d prime for all possible d = 14 + 18*k, k = -1/2, 0, 1, 2, 3, ...
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Freeman J. Dyson, Norman E. Frankel, Anthony J. Guttmann: SanD primes and numbers, arxiv:1904.03573 [math.CA], April 7, 2019
EXAMPLE
a(1) = 2 = A307480(-1) is the smallest (and only) SanD-5 prime: 2 and 2 + 5 = 7 both are prime, and the digit sum A007953(2*7) = 1 + 4 = 5.
All other SanD primes must have a gap and sum d = 14 + 18*k, k = 0, 1, 2, ...
a(2) = 5 = A307471(1) = A307480(0) is the smallest SanD-14 prime: 5 and 5 + 14 = 19 both are prime and the digit sum A007953(5*19) = 9 + 5 = 14.
a(10) = 149 = A307472(1) = A307480(1) is the smallest SanD-32 prime: 149 and 149 + 32 = 181 both are prime, and the digit sum A007953(149*181) = 2+6+9+6+9 = 32.
MAPLE
filter:= proc(p) local d;
if not isprime(p) then return false fi;
for d from 14 by 18 while is(d <= 9*log[10](p*(p+d))+1) do
if isprime(p+d) and convert(convert(p*(p+d), base, 10), `+`)=d then return true fi
od:
false
end proc:
filter(2):= true:
select(filter, [2, seq(i, i=5..10000, 6)]); # Robert Israel, Apr 10 2019
PROG
(PARI) A307479_upto(LIM=2e4, A=List(2))={ forstep(d=14, oo, 18, my(L=#A); forprime(p=3, LIM, isprime(p+d) && sumdigits(p*(p+d))==d && listput(A, p)); L==#A && break); Set(A)}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Apr 09 2019
STATUS
approved