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

A004678 Primes written in base 4.

Original entry on oeis.org

2, 3, 11, 13, 23, 31, 101, 103, 113, 131, 133, 211, 221, 223, 233, 311, 323, 331, 1003, 1013, 1021, 1033, 1103, 1121, 1201, 1211, 1213, 1223, 1231, 1301, 1333, 2003, 2021, 2023, 2111, 2113, 2131, 2203, 2213, 2231, 2303, 2311, 2333, 3001, 3011, 3013
Offset: 1

Views

Author

Keywords

Crossrefs

Analogs in other bases: A004676 (base 2), A001363 (base 3), A004679 (base 5), A004680 (base 6), A004681 (base 7), A004682 (base 8), A004683 (base 9), A000040 (base 10), A004684 (base 11).
Cf. A072805 (primes of form 4k+3 written in base 3).

Programs

  • Magma
    [Seqint(Intseq(NthPrime(n), 4)): n in [1..60]]; // G. C. Greubel, Oct 12 2018
  • Mathematica
    FromDigits/@IntegerDigits[Prime[Range[50]],4] (* Vincenzo Librandi, Sep 03 2016 *)
  • PARI
    a(n)=subst(Pol(digits(prime(n),4)),'x,10) \\ Charles R Greathouse IV, Nov 06 2013
    

Formula

a(n) = A007090(A000040(n)). - Jonathan Vos Post, Sep 09 2006

Extensions

More terms from Vincenzo Librandi, Sep 03 2016

A004680 Primes written in base 6.

Original entry on oeis.org

2, 3, 5, 11, 15, 21, 25, 31, 35, 45, 51, 101, 105, 111, 115, 125, 135, 141, 151, 155, 201, 211, 215, 225, 241, 245, 251, 255, 301, 305, 331, 335, 345, 351, 405, 411, 421, 431, 435, 445, 455, 501, 515, 521, 525, 531, 551, 1011, 1015, 1021, 1025, 1035
Offset: 1

Views

Author

Keywords

Crossrefs

Analogs in other bases: A004676 (base 2), A001363 (base 3), A004678 (base 4), A004679 (base 5), A004681 (base 7), A004682 (base 8), A004683 (base 9), A000040 (base 10), A004684 (base 11).
Cf. A007092.

Programs

  • Magma
    [Seqint(Intseq(NthPrime(n),6)): n in [1..60]]; // G. C. Greubel, Oct 10 2018
  • Mathematica
    FromDigits/@IntegerDigits[Prime[Range[50]], 6] (* Vincenzo Librandi, Sep 03 2016 *)
  • PARI
    a(n)=subst(Pol(digits(prime(n),6)),'x,10) \\ Charles R Greathouse IV, Nov 06 2013
    
  • PARI
    vector(60, n, fromdigits(digits(prime(n), 6))) \\ G. C. Greubel, Oct 10 2018
    

Formula

a(n) = A007092(prime(n)). - Michel Marcus, Sep 03 2016

A340290 Numbers k that are the representation of primes in base 3 and in base 4.

Original entry on oeis.org

2, 1121, 2021, 2111, 10121, 10211, 11201, 12011, 12121, 12211, 21101, 21211, 22111, 101021, 101111, 110021, 110111, 110221, 111211, 112001, 121001, 121021, 122011, 200111, 201101, 210011, 211021, 211111, 222221, 1000211, 1002011, 1010111, 1011121, 1012201, 1021001
Offset: 1

Views

Author

Bernard Schott, Jan 03 2021

Keywords

Comments

Except for a(1) = 2, which is the only even prime, all terms end with 1.
The corresponding sequences of primes are A235473 (for base 3) and A235467 (for base 4) (see examples).
As 1381 = 1220011_3 = 111211_4, prime 1381 occurs twice and is the next such prime after 2 (see example), which has a representation in base 3 and a representation in base 4 that are both terms of this sequence.

Examples

			a(1) = 2 and 2_3 = 2_4 = 2_10.
a(2) = 1121 because 1121_3 = 43_10 and 1121_4 = 89_10 are primes.
a(3) = 2021 because 2021_3 = 61_10 and 2021_4 = 137_10 are primes.
		

Crossrefs

Intersection of A001363 and A004678.
Cf. A089981 (bases 3 and 10).

Programs

  • Mathematica
    f[n_] := Module[{d = IntegerDigits[n, 3]}, If[PrimeQ[FromDigits[d, 4]], FromDigits[d, 10], 0]]; seq = {}; Do[If[PrimeQ[n], m = f[n]; If[m > 0, AppendTo[seq, m]]], {n, 2, 1000}]; seq (* Amiram Eldar, Jan 03 2021 *)
    FromDigits[#]&/@Select[Tuples[{0,1,2},7],PrimeQ[FromDigits[#,4]] && PrimeQ[ FromDigits[ #,3]]&] (* Harvey P. Dale, Dec 15 2021 *)
  • PARI
    f(n, b) = fromdigits(digits(n, b));
    my(vp=primes(700)); setintersect(apply(x->f(x,3), vp), apply(x->f(x,4), vp)) \\ Michel Marcus, Jan 04 2021
    
  • PARI
    forprime(p=2, 10^3, my(t=digits(p,3)); if( isprime( fromdigits(t,4)), print1(fromdigits(t,10),", "))) \\ Joerg Arndt, Jan 04 2021
    
  • Python
    from sympy import prime, isprime
    from sympy.ntheory.factor_ import digits
    A340290_list = [int(s) for s in (''.join(str(d) for d in digits(prime(i),3)[1:]) for i in range(1,1000)) if isprime(int(s,4))] # Chai Wah Wu, Jan 09 2021

Extensions

More terms from Amiram Eldar, Jan 03 2021

A178388 Concatenation of the first n primes written in base 3.

Original entry on oeis.org

2, 210, 21012, 2101221, 2101221102, 2101221102111, 2101221102111122, 2101221102111122201, 2101221102111122201212, 21012211021111222012121002, 210122110211112220121210021011, 2101221102111122201212100210111101
Offset: 1

Views

Author

Jonathan Vos Post, May 26 2010

Keywords

Examples

			a(4) = Concatenate[prime(1) base 3, prime(2) base 3, prime(3) base 3, prime(3) base 3] = Concatenate[2 base 3, 3 base 3, 5 base 3, 7 base 3] = Concatenate[2, 10, 12, 21] = 2101221.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=15,p3},p3=IntegerDigits[Prime[Range[nn]],3];Table[FromDigits[Flatten[ Take[p3,n]]],{n,nn}]] (* Harvey P. Dale, Aug 25 2022 *)
  • PARI
    v = 0; for (n=1, 12, d = digits(prime(n), 3); v = v*10^#d + fromdigits(d); print1 (v ", ")) \\ Rémy Sigrist, Aug 07 2017

Extensions

Edited by N. J. A. Sloane, Jul 02 2017

A280997 Primes that have exactly 3 ones in both their binary and ternary expansions.

Original entry on oeis.org

13, 37, 41, 67, 97, 131, 193, 577, 1033, 1153, 2053, 4129, 8209, 18433, 32771, 32801, 32833, 65539, 133121, 525313, 557057, 1049089, 4194433, 167772161, 268435459
Offset: 1

Views

Author

K. D. Bajpai, Jan 12 2017

Keywords

Comments

Sequence is likely to be finite. If it exists, a(26) > 10^200. - Robert Israel, Jan 12 2017

Examples

			37 is in the sequence because it is a prime and its binary expansion 100101 and ternary expansion 1101 both have exactly 3 ones.
131 is in the sequence because it is a prime and its binary expansion 10000011 and ternary expansion 11212 both have exactly 3 ones.
		

Crossrefs

Programs

  • Maple
    A:= NULL:
    for a from 2 to 100 do
      for b from 1 to a-1 do
        p:= 2^a + 2^b + 1;
        if numboccur(1, convert(p,base,3)) = 3 and isprime(p) then
          A:= A, p
        fi
    od od:
    A; # Robert Israel, Jan 12 2017
  • Mathematica
    Select[Prime[Range[500000]], Count[IntegerDigits[#, 3], 1] == Count[IntegerDigits[#, 2], 1] == 3 &]
    Select[Prime[Range[300000]],DigitCount[#,2,1]==DigitCount[#,3,1]==3&] (* The program generates the first 23 terms of the sequence. *) (* Harvey P. Dale, Jul 20 2025 *)
Showing 1-5 of 5 results.