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!)
A240570 Prime numbers n such that replacing each digit in the decimal expansion of n with the sum of the other digits produces a prime. 0

%I #6 Sep 13 2017 00:03:46

%S 11,13,17,31,37,71,73,79,97,127,163,181,211,257,271,277,293,307,349,

%T 367,431,433,457,491,521,523,541,563,587,631,659,743,839,983,10069,

%U 10151,10337,10429,10559,10889,10973,11059,11251,11329,11411,11437,11471,11617

%N Prime numbers n such that replacing each digit in the decimal expansion of n with the sum of the other digits produces a prime.

%C Let d(1)d(2)...d(q) denote the decimal expansion of a prime number. Replace each digit d(i) in decimal expansion of n with Sum_{j=1..q, j<>i} d(j) such that the result is a prime number.

%C The corresponding primes are 11, 31, 71, 13, 73, 17, 37, 97, 79, 983, 947, 929, 233, 1297, 839, 1499, ...

%e 983 is in the sequence because 983 becomes 111217 which is also prime, where 11=8+3, 12=9+3 and 17=9+8.

%p with(numtheory):T:=array(1..10):

%p for n from 1 to 1000 do:

%p p:=ithprime(n):k:=0:s:=0:j:=0:

%p x:=convert(p,base,10):n1:=nops(x):

%p s1:=sum('x[i]', 'i'=1..n1):

%p for m from n1 by -1 to 1 do:

%p k:=k+1:T[k]:=s1-x[m]:

%p od:

%p n2:=sum('length(T[j])', 'j'=1..n1):s2:=0:

%p for u from 1 to n1 do:

%p s2:=s2+ T[u]*10^(n2-length(T[u])):n2:=n2-length(T[u]):

%p od:

%p if type(s2,prime)=true

%p then

%p printf(`%d, `,p):

%p else

%p fi:

%p od:

%K nonn,base

%O 1,1

%A _Michel Lagneau_, Apr 08 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 24 13:58 EDT 2024. Contains 371960 sequences. (Running on oeis4.)