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.

Showing 1-4 of 4 results.

A082555 Primes whose base-3 representation does not contain a 0.

Original entry on oeis.org

2, 5, 7, 13, 17, 23, 41, 43, 53, 67, 71, 79, 131, 149, 151, 157, 211, 229, 233, 239, 241, 367, 373, 401, 449, 457, 607, 617, 619, 643, 647, 691, 701, 719, 727, 1093, 1097, 1103, 1123, 1129, 1187, 1201, 1213, 1367, 1373, 1427, 1429, 1447, 1453, 1823, 1831, 1861
Offset: 1

Views

Author

Randy L. Ekl, May 03 2003

Keywords

Comments

Primes in A032924. - Robert Israel, Dec 28 2018
The analog "primes without digit 2 in ternary" is A077717. There is no prime > 2 not having the digit 1 in ternary, since then the number is divisible by 2. - M. F. Hasler, Feb 15 2023

Examples

			41 = 1112_3, which contains no 0.
		

Crossrefs

Cf. A032924 (numbers without digit 0 in base 3), A073779, A077267.
Cf. A077717 (primes that are the sum of distinct powers of 3 <=> base-3 representation does not contain a digit 2).

Programs

  • Maple
    select(t -> isprime(t) and not(has(convert(t,base,3),0)), [2,seq(i,i=5..10000,2)]); # Robert Israel, Dec 28 2018
  • PARI
    dec3(s)=while(s>0,if(s%3==0,return(0),s=floor(s/3))); return(1)
    forprime(i=1,20000,if(dec3(i)==1,print1(i,", "),))
    
  • Python
    def is_A082555(n): return is_A032924(n) and A010051(n)
    [p for p in range(1888) if is_A082555(p)] # M. F. Hasler, Feb 15 2023

A073780 Number of 1's in base 3 representation of n-th prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 3, 5, 3, 3, 3, 3, 1, 3, 5, 3, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Zak Seidov Aug 11 2002

Keywords

Examples

			a1(11)=3 as 11th prime, 31, is 1011 in base 3 representation.
		

Crossrefs

Programs

  • Mathematica
    a1[n_] := Length[Cases[IntegerDigits[Prime[n], 3], 1]]
    Table[DigitCount[n,3,1],{n,Prime[Range[100]]}] (* Harvey P. Dale, Feb 23 2015 *)

Formula

a(n) = A062756(A000040(n)). - Michel Marcus, Oct 02 2013

A073781 Number of 2's in base-3 representation of n-th prime.

Original entry on oeis.org

1, 0, 1, 1, 1, 0, 2, 1, 2, 1, 0, 0, 1, 1, 2, 3, 2, 2, 1, 3, 2, 3, 1, 2, 1, 2, 1, 3, 0, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 1, 3, 1, 2, 3, 3, 2, 4, 4, 4, 2, 1, 2, 3, 0, 1, 1, 0, 2, 1, 2, 2, 3, 1, 0, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 3
Offset: 1

Views

Author

Zak Seidov Aug 11 2002

Keywords

Examples

			a(7)=2 as 7th prime 17 is 122 in base-3 representation.
		

Crossrefs

Programs

  • Mathematica
    a2[n_] := Length[Cases[IntegerDigits[Prime[n], 3], 2]]
    DigitCount[Prime[Range[90]],3,2] (* Harvey P. Dale, May 11 2016 *)

Formula

a(n) = A081603(A000040(n)). - Michel Marcus, Oct 02 2013

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

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 89, 101, 103, 107, 109, 127, 149, 151, 157, 167, 173, 181, 191, 223, 229, 233, 239, 251, 347, 349, 359, 367, 373, 379, 383, 409, 421, 431, 439, 443, 479, 487, 491, 503, 509, 599, 601, 607, 613, 617, 619
Offset: 1

Views

Author

Jonathan D. B. Hodgson, Oct 08 2010

Keywords

Comments

This sequence contains all Mersenne primes (i.e. this is a supersequence of A000668). - Iain Fox, Dec 25 2017

Examples

			53 = 311 (base 4), which contains no 0.
		

Crossrefs

Cf. A082555, A000668 (subsequence).
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

Programs

  • Magma
    [ p: p in PrimesUpTo(620) | not exists(t){d: d in Intseq(p, 4) | d eq 0 } ]; // Klaus Brockhaus, Oct 10 2010
    
  • Maple
    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))];
    # Alternative:
    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
  • Mathematica
    Select[Prime@ Range@ 120, DigitCount[#, 4, 0] == 0 &] (* Michael De Vlieger, Dec 24 2017 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if(!setsearch(Set(digits(p, 4)), 0), print1(p, ", "))) \\ Iain Fox, Dec 25 2017
Showing 1-4 of 4 results.