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.

A171008 Write the n-th prime in binary and change all 0's to 1's and all 1's to 0's.

This page as a plain text file.
%I A171008 #11 Apr 01 2019 02:23:00
%S A171008 1,0,10,0,100,10,1110,1100,1000,10,0,11010,10110,10100,10000,1010,100,
%T A171008 10,111100,111000,110110,110000,101100,100110,11110,11010,11000,10100,
%U A171008 10010,1110,0,1111100,1110110,1110100,1101010,1101000,1100010,1011100
%N A171008 Write the n-th prime in binary and change all 0's to 1's and all 1's to 0's.
%p A171008 A171008 := proc(n) local p2 ; p2 := convert(ithprime(n),base,2) ; add( (1-op(i,p2)) *10^(i-1),i=1..nops(p2)) ; end proc: seq(A171008(n),n=1..80) ; # _R. J. Mathar_, Sep 04 2010
%t A171008 FromDigits/@(IntegerDigits[#,2]&/@Prime[Range[40]]/.{0->1,1->0}) (* _Harvey P. Dale_, Aug 19 2017 *)
%o A171008 (PARI) a(n)=my(v=binary(prime(n)),k=1/10);sum(i=0,#v-1,k*=10;(1-v[ #v-i])*k) \\ _Charles R Greathouse IV_, Sep 08 2010
%Y A171008 See A145382 for the decimal equivalents.
%K A171008 nonn,base
%O A171008 1,3
%A A171008 _N. J. A. Sloane_, Sep 03 2010
%E A171008 More terms from _Charles R Greathouse IV_ and _R. J. Mathar_, Sep 04 2010