OFFSET
1,2
COMMENTS
The sequence A020449 (primes that contain digits 0 and 1 only) is a subsequence because if n is prime, phi(n) = n-1 also contains only digits 0 and 1. The semiprimes in the sequence are 1111, 110111111, 1111011011, 11000111111, ... (see the sequence A203897) whose prime factors are also in the sequence, and whose smallest divisor is 11 or 101, for example 110111111=11*10010101 => 11 and 10010101 are in the sequence.
What is the smallest n with a(n) <> A209930(n)? - Alois P. Heinz, Jul 16 2014
The first term after 1 that is not a prime or semiprime is a(8079) = 111100111111111111 = 11*101*100000100010001. - Robert Israel, Mar 05 2018
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Jan 07 2012
EXTENSIONS
"Positive" added by N. J. A. Sloane, Dec 27 2019
STATUS
approved