A203304 Positive numbers n such that n and phi(n) contain digits 0 and 1 only.
1, 11, 101, 1111, 10111, 101111, 1011001, 1100101, 10010101, 10011101, 10100011, 10101101, 10110011, 10111001, 11000111, 11100101, 11110111, 11111101, 100100111, 100111001, 101001001, 101001011, 101100011, 101101111, 101111011, 101111111, 110010101, 110101001
Offset: 1
Examples
1111 is in the sequence because phi(1111) = 1000 contains digits 0 and 1 only. This number is composite, 1111 = 11*101 => 11 and 101 are in the sequence.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Programs
-
Maple
with(numtheory): T:=array(1..64):k:=1:a:={0,1}:b:={1}: for a9 from 0 to 1 do: for a8 from 0 to 1 do: for a7 from 0 to 1 do: for a6 from 0 to 1 do: for a5 from 0 to 1 do: for a4 from 0 to 1 do: for a3 from 0 to 1 do: for a2 from 0 to 1 do: for a1 from 0 to 1 do: for a0 from 0 to 1 do:n:=a0+a1*10+a2*10^2+ a3*10^3+ a4*10^4+ a5*10^5+ a6*10^6+ a7*10^7+ a8*10^8+ a9*10^9: m:=phi(n):x:=convert(convert(m,base,10),set): if a union x = a or a union x = b then T[k]:=n:k:=k+1:else fi:od: od: od: od: od: od: od: od: od:od: print(T):
-
Mathematica
d = Table[FromDigits[IntegerDigits[n, 2]], {n, 10000}]; Select[d, Max[IntegerDigits[EulerPhi[#]]] == 1 &] (* T. D. Noe, Jan 11 2012 *) Select[FromDigits/@Tuples[{0,1},9],SubsetQ[{0,1},IntegerDigits[ EulerPhi[ #]]]&]//Rest (* Harvey P. Dale, Dec 27 2019 *)
-
PARI
has(n)=my(d=Set(digits(n))); d[#d]<2 is(n)=has(n) && has(eulerphi(n)) \\ Charles R Greathouse IV, Nov 25 2014
Extensions
"Positive" added by N. J. A. Sloane, Dec 27 2019
Comments