login
Numbers n such that sum of decimal digits of n divides phi(n).
1

%I #31 Sep 08 2022 08:46:03

%S 1,10,11,13,17,20,21,27,35,39,40,41,42,43,50,54,55,57,63,80,81,82,84,

%T 86,92,93,97,100,101,105,108,110,111,112,114,116,117,122,126,129,130,

%U 131,135,142,143,147

%N Numbers n such that sum of decimal digits of n divides phi(n).

%C Sometimes referred to as balanced numbers.

%C The sequence is infinite because for k>= 1, phi(10^k) = 4*10^(k-1) and digitsum (10^k) = 1. - _Marius A. Burtea_, Dec 20 2018

%C If n is in the sequence, then so is 10*n. - _Robert Israel_, Dec 20 2018

%D James J. Tattersall, Elementary Number Theory in Nine Chapters, 2nd ed., Cambridge University Press, 2005, page 193, exercise 15.

%H Marius A. Burtea and Muniru A Asiru, <a href="/A216836/b216836.txt">Table of n, a(n) for n = 1..10000</a> (first 3028 terms from Marius A. Burtea)

%e 39 is in the sequence since its sum of digits (12) divides phi(39) = 24.

%p select(n -> numtheory:-phi(n) mod convert(convert(n,base,10),`+`) = 0, [$1..1000]); # _Robert Israel_, Dec 20 2018

%t Select[Range[1000], Mod[EulerPhi[#], Total @ IntegerDigits[#]] == 0 &] (* _Giovanni Resta_, Mar 16 2013 *)

%o (Magma) [n: n in [1..1000] | IsIntegral((EulerPhi(n))/&+Intseq(n))];// _Marius A. Burtea_, Dec 20 2018

%o (GAP) nmax:=150;;

%o S:=List(List([1..nmax],n->ListOfDigits(n)),Sum);; P:=List([1..nmax],n->Phi(n));;

%o a:=Filtered([1..nmax],i->P[i] mod S[i]=0); # _Muniru A Asiru_, Dec 20 2018

%K nonn,base,easy

%O 1,2

%A _Jayanta Basu_, Mar 16 2013