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-3 of 3 results.

A073779 Number of 0's in base-3 representation of n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Aug 11 2002

Keywords

Comments

a(n) = 0 if prime(n) is in A082555. - Robert Israel, Dec 28 2018

Examples

			a(10)=2 as 10th prime is 29 in base-10 representation, or 1002 in base-3 representation.
		

Crossrefs

Programs

  • Magma
    [ Multiplicity({* a: a in Intseq(p, 3) *}, 0): p in PrimesUpTo(600) ]; // Klaus Brockhaus, Oct 10 2010
  • Maple
    f:= n -> numboccur(0,convert(ithprime(n),base,3)):
    map(f, [$1..200]); # Robert Israel, Dec 28 2018
  • Mathematica
    A073779[n_] := Length[Cases[IntegerDigits[Prime[n], 3], 0]];
    DigitCount[#,3,0]&/@Prime[Range[120]]  (* Harvey P. Dale, Apr 26 2011 *)

Formula

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

Extensions

More terms from Klaus Brockhaus, Oct 10 2010

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

A181173 Primes whose base 5 representation does not contain a 0.

Original entry on oeis.org

2, 3, 7, 11, 13, 17, 19, 23, 31, 37, 41, 43, 47, 59, 61, 67, 71, 73, 83, 89, 97, 107, 109, 113, 157, 163, 167, 173, 181, 191, 193, 197, 199, 211, 223, 233, 239, 241, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 359, 367, 373, 409, 419, 421, 431, 433
Offset: 1

Views

Author

Jonathan D. B. Hodgson, Oct 08 2010

Keywords

Examples

			23 = 43 (base 5) which contains no 0.
		

Crossrefs

Cf. A082555.

Programs

  • Maple
    The following stores the first 200 digits of the sequence in K: for i from 1 to 200 do if i=i then x[i]:=convert(ithprime(i),base,5) 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))];
Showing 1-3 of 3 results.