login
Numbers k such that the sum of the digits and the sum of the square of the digits of k are prime factors of k.
1

%I #161 Jul 19 2020 11:53:21

%S 110,111,120,133,210,803,1010,1011,1020,1100,1101,1110,1200,1330,2010,

%T 2023,2100,8030,10010,10011,10020,10100,10101,10110,10200,11000,11001,

%U 11010,11100,12000,12110,13300,20010,20100,20230,21000,80300,100010,100011,100020

%N Numbers k such that the sum of the digits and the sum of the square of the digits of k are prime factors of k.

%C Subsequence of A062713.

%C The corresponding pairs of primes factors are (2, 2), (3, 3), (3, 5), (7, 19), (3, 5), (11, 73), (2, 2), (3, 3), (3, 5), (2, 2), (3, 3), (3, 3), (3, 5), (7, 19), (3, 5), (7, 17), (3, 5), (11, 73), (2, 2), ... with many repetitions of some pairs.

%C {a(n)} = E1 union E2 where E1 = {110, 111, 120, 133, 210, ...} is the subsequence of primitive values, and E2 = {1100, 1110, 1200, ...} is the subsequence of the non-primitive values. The subsequence E1 = F1 union F2 where F1 is the finite subsequence having distinct decimal digits. F1 starts with 120, 210, 803, 615784, 1742386, 2341678, 3059824, 3075914, 5910374, 6157840, 6285901, 8234716, 8734126, 8951024, 9150428, 12946078, ... with the corresponding pairs of prime factors (3, 5), (3, 5), (11, 73), (31, 191), (31, 179), (31, 179), (31, 199), (29, 181), (29, 181), (31, 191), (31, 211), (31, 179), (31, 179), (29, 191), (29, 191), (37, 251), ...

%C We observe repetitions of some pairs : (3, 5), (31, 191), (31, 179), (29, 181), (29, 171), ...

%C F2, the set of numbers having at least two identical digits, is infinite because it contains all the numbers of the form 10^k + 10^j + 1 with k > j > 0. - _Giovanni Resta_, May 08 2019

%C If k is in the sequence then so is 10*k. - _David A. Corneth_, May 08 2019

%H Georg Fischer, <a href="/A306701/b306701.txt">Table of n, a(n) for n = 1..300</a>

%e 120 is an element because 1 + 2 + 0 = 3 and 1^2 + 2^2 + 0^2 = 5 are prime factors of 120;

%e 615784 is an element because 6 + 1 + 5 + 7 + 8 + 4 = 31 and 6^2 + 1^2 + 5^2 + 7^2 + 8^2 + 4^2 = 191 are prime factors of 615784 = 2^3 * 13 * 31 * 191.

%p with(numtheory):nn:=20000:

%p for n from 1 to nn do:

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

%p s1:=sum(‘x[i]’, ‘i’=1..n0):s2:=sum(‘x[i]^2’, ‘i’=1..n0):

%p if isprime(s1) and isprime(s2) and irem(n,s1)=0 and irem(n,s2)=0

%p then

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

%p else

%p fi:

%p od:

%t sd2Q[n_]:=Module[{idn=Total[IntegerDigits[n]],idn2=Total[ IntegerDigits[ n]^2],f= FactorInteger[ n][[All,1]]},AllTrue[{idn,idn2},PrimeQ] && MemberQ[ f,idn]&&MemberQ[f,idn2]]; Select[Range[101000],sd2Q] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jul 15 2020 *)

%o (MATLAB) m=1;

%o for u=1:200000

%o digit=dec2base(u,10)-'0'; digit1=digit.^2; s1=sum(digit); s2=sum(digit1);

%o if and(isprime(s1)==1,isprime(s2)==1)

%o if and(mod(u,s1)==0,mod(u,s2)==0)

%o sol(m)=u;

%o m=m+1;

%o end

%o end

%o end

%o sol % _Marius A. Burtea_, May 08 2019

%o (PARI) isok(n) = my(d=digits(n), sd = vecsum(d), sd2 = sum(k=1, #d, d[k]^2)); isprime(sd) && isprime(sd2) && !(n%sd) && !(n%sd2); \\ _Michel Marcus_, May 11 2019

%Y Cf. A003132, A007953, A062713

%K nonn,base

%O 1,1

%A _Michel Lagneau_, May 08 2019