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.

A181172 Primes whose base 4 representation does not contain a 0.

This page as a plain text file.
%I A181172 #18 Sep 08 2022 08:45:54
%S A181172 2,3,5,7,11,13,23,29,31,37,41,43,47,53,59,61,89,101,103,107,109,127,
%T A181172 149,151,157,167,173,181,191,223,229,233,239,251,347,349,359,367,373,
%U A181172 379,383,409,421,431,439,443,479,487,491,503,509,599,601,607,613,617,619
%N A181172 Primes whose base 4 representation does not contain a 0.
%C A181172 This sequence contains all Mersenne primes (i.e. this is a supersequence of A000668). - _Iain Fox_, Dec 25 2017
%H A181172 Robert Israel, <a href="/A181172/b181172.txt">Table of n, a(n) for n = 1..10000</a>
%e A181172 53 = 311 (base 4), which contains no 0.
%p A181172 The following code will store the first 200 terms into a sequence K. for i from 1 to 200 do if i=i then x[i]:=convert(ithprime(i),base,4) else x[i]:=0 end if: end do: S:={}: for i from 1 to 200 do if evalb(`in`(0, x[i]))=false then S:=S union {i} fi od; for i from 1 to nops(S)do z[i]:=ithprime(S[i]) od: K:=[seq((z[i]),i=1..nops(S))];
%p A181172 # Alternative:
%p A181172 select(t -> isprime(t) and not has(convert(t,base,4),0), [2,seq(i,i=3..10^4,2)]); # _Robert Israel_, Dec 24 2017
%t A181172 Select[Prime@ Range@ 120, DigitCount[#, 4, 0] == 0 &] (* _Michael De Vlieger_, Dec 24 2017 *)
%o A181172 (Magma) [ p: p in PrimesUpTo(620) | not exists(t){d: d in Intseq(p, 4) | d eq 0 } ]; // _Klaus Brockhaus_, Oct 10 2010
%o A181172 (PARI) lista(nn) = forprime(p=2, nn, if(!setsearch(Set(digits(p, 4)), 0), print1(p, ", "))) \\ _Iain Fox_, Dec 25 2017
%Y A181172 Cf. A082555, A000668 (subsequence).
%Y A181172 Cf. A073779 (number of 0's in base-3 representation of n-th prime), A181173 (primes whose base 5 representation does not contain a 0). - _Klaus Brockhaus_, Oct 10 2010
%K A181172 base,nonn
%O A181172 1,1
%A A181172 _Jonathan D. B. Hodgson_, Oct 08 2010