cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A203304 Positive numbers n such that n and phi(n) contain digits 0 and 1 only.

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Jan 07 2012

Keywords

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

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.
		

Crossrefs

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