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.

A203897 Nonprime numbers k >= 1 such that k and phi(k) contain only digits 0 and 1.

This page as a plain text file.
%I A203897 #31 Jan 17 2023 16:49:52
%S A203897 1,1111,110111111,1111011011,11000111111,110011011011,110111101111,
%T A203897 111100011011,111101010101,111101111011,1010011111111,1010101001111,
%U A203897 1010101101101,1010111100101,1011111001111,1100000111111,1100110011011,1111001011111,1111001101111
%N A203897 Nonprime numbers k >= 1 such that k and phi(k) contain only digits 0 and 1.
%C A203897 From _Robert Israel_, Feb 26 2018: (Start)
%C A203897 Many terms are semiprimes of the form p*q where p = 11 or 101 and q is in A020449.
%C A203897 The first term after 1 that is not a semiprime is a(199) = 111100111111111111 = 11*101*100000100010001.
%C A203897 The first term after 1 that is not divisible by 11 or 101 is a(1023) = 1110010101001011111101 = 11111101 * 99901000000001. (End)
%H A203897 Robert Israel, <a href="/A203897/b203897.txt">Table of n, a(n) for n = 1..2000</a>
%e A203897 a(3) = 110111111 = 11*10010101 is in the sequence because phi(110111111) = 100101000, which contains digits 0 and 1 only.
%e A203897 Remark: phi(11)=10, phi(10010101)=10010100, but 100101000 = 2*3*5*61*547.
%p A203897 with(numtheory): T:=array(1..23):k:=1:a:={0,1}:b:={1}:for a12 from 0 to 1 do: for a11 from 0 to 1 do: for a10 from 0 to 1 do: 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 + a10*10^10+ a11*10^11+ a12*10^12: m:=phi(n):x:=convert(convert(m,base,10),set): if type(n,prime)=false and (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:od:od:od: print(T):
%p A203897 Res:= NULL: count:= 0:
%p A203897 for q from 1 while count < 100 do
%p A203897   L:= convert(q,base,2);
%p A203897   n:=add(L[i]*10^(i-1),i=1..nops(L));
%p A203897   if isprime(n) then next fi;
%p A203897   r:= numtheory:-phi(n);
%p A203897   if max(convert(r,base,10))=1 then
%p A203897     Res:= Res, n;
%p A203897     count:= count+1;
%p A203897   fi
%p A203897 od:
%p A203897 Res; # _Robert Israel_, Feb 26 2018
%t A203897 d = Table[FromDigits[IntegerDigits[n, 2]], {n, 10000}]; Select[d, ! PrimeQ[#] && Max[IntegerDigits[EulerPhi[#]]] == 1 &] (* _T. D. Noe_, Jan 11 2012 *)
%t A203897 Rest[Select[FromDigits/@Tuples[{0,1},13],!PrimeQ[#]&&Max[IntegerDigits[ EulerPhi[ #]]] <2&]] (* _Harvey P. Dale_, Jan 17 2023 *)
%o A203897 (PARI) lista(nn) = {for (n=1, nn, x = fromdigits(binary(n), 10); if (! isprime(x) && (vecmax(digits(eulerphi(x))) < 2), print1(x, ", ")););} \\ _Michel Marcus_, Jun 12 2017
%Y A203897 Cf. A000010, A020449, A203304.
%K A203897 nonn,base
%O A203897 1,2
%A A203897 _Michel Lagneau_, Jan 07 2012
%E A203897 Incorrect comments deleted by _Robert Israel_, Feb 26 2018
%E A203897 Definition edited by _N. J. A. Sloane_, Jan 17 2023 at the suggestion of _Harvey P. Dale_.