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

A001363 Primes in ternary.

Original entry on oeis.org

2, 10, 12, 21, 102, 111, 122, 201, 212, 1002, 1011, 1101, 1112, 1121, 1202, 1222, 2012, 2021, 2111, 2122, 2201, 2221, 10002, 10022, 10121, 10202, 10211, 10222, 11001, 11012, 11201, 11212, 12002, 12011, 12112, 12121, 12211, 20001, 20012, 20102, 20122, 20201
Offset: 1

Views

Author

Keywords

Comments

Primes written in base 3.

References

  • Archimedeans Problems Drive, Eureka, 23 (1960), 23.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

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

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[Prime[n], 3]], {n, 50}] (* T. D. Noe, Jun 28 2012 *)
  • PARI
    a(n)=subst(Pol(digits(prime(n),3)),'x,10) \\ Charles R Greathouse IV, Nov 06 2013

Formula

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

Extensions

More terms from James Sellers, May 01 2000

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

A065722 Primes that when written in base 4, then reinterpreted in base 10, again give primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 61, 71, 73, 79, 83, 97, 103, 107, 109, 113, 131, 149, 151, 157, 163, 167, 181, 191, 193, 197, 227, 233, 241, 251, 277, 293, 307, 311, 313, 317, 349, 359, 373, 389, 401, 419, 421, 433, 443, 449, 463, 467, 503
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p4 = (4) [p] (10).

Examples

			The decimal prime 29 in base 4 is 131 which is again a prime in base 10.
E.g., 509_10 = 13331_4 is prime but also 13331_10.
		

Crossrefs

Programs

  • Maple
    A007090 := proc(n) local b4digs ; b4digs := convert(n,base,4) ; add( op(i,b4digs)*10^(i-1),i=1..nops(b4digs)) ; end: isA065722 := proc(n) local rebase ; if isprime(n) then rebase := A007090(n) ; RETURN(isprime(rebase)) ; else RETURN(false) ; fi ; end: for n from 1 to 1000 do p := ithprime(n) : if isA065722(p) then printf("%d, ",p) ; fi : od : # R. J. Mathar, Jun 15 2007
  • Mathematica
    Select[ Range[505], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 4]]] & ]
  • PARI
    isok(p)={ isprime(p) && isprime(fromdigits(digits(p,4))) } \\ Harry J. Smith, Oct 27 2009

Formula

Numbers n such that A049084(n)>0 and A049084(A007090(n))>0. - R. J. Mathar, Jun 15 2007

Extensions

Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

A163291 Number of digits of n-th prime written in base 4.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 24 2009

Keywords

Examples

			6th prime = 13 = 31_4, so a(6) = 2;
7th prime = 17 = 101_4, so a(7) = 3;
54th prime = 251 = 3323_4, so a(54) = 4;
55th prime = 257 = 10001_4, so a(55) = 5.
		

Crossrefs

Programs

  • Mathematica
    IntegerLength[#, 4] & /@ Prime[Range[100]] (* G. C. Greubel, Dec 17 2016 *)
  • PARI
    a(n) = #digits(prime(n), 4); \\ Michel Marcus, Dec 18 2016

Formula

a(n) = log_4 n + log_4 log n + O(1). - Charles R Greathouse IV, Mar 25 2010

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

A036955 Numbers whose base-4 representation is the decimal representation of a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 55, 61, 71, 73, 77, 79, 83, 91, 97, 103, 107, 109, 113, 115, 121, 131, 133, 149, 151, 157, 163, 167, 169, 181, 191, 193, 197, 203, 217, 227, 233, 241, 247, 251, 253, 275, 277, 287, 293, 299, 305, 307, 311, 313
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

All terms are congruent to 1 or 3 (mod 4) (except for the first one) and congruent to 1 or 5 (mod 6) (except for the first two); although not all terms are prime, as e.g., 55, 77, 91, 115, 121, 133, 169, 203, ... - M. F. Hasler, Jul 25 2015
Numbers (not necessarily prime) which are prime if written in base 4 and reinterpreted in base 10. Numbers n such that A007090(n) is in A000040. - R. J. Mathar, Jul 28 2015

Examples

			55 is in the sequence because 55_10 = 313_4 and 313_10 is prime.
313 is in the sequence because 313_10 = 10321_4 and 10321_10 is prime.
31 is not in the sequence because 31_10 = 133_4 and 133_10 = 7*19 is not prime.
		

Crossrefs

Programs

  • Mathematica
    FromDigits[IntegerDigits[#],4]&/@Select[Prime[Range[2000]],Max[ IntegerDigits[ #]]<4&] (* Harvey P. Dale, May 02 2015 *)
  • PARI
    is(n)=isprime(sum(i=1,#n=digits(n,4),n[i]*10^(#n-i))) \\ M. F. Hasler, Jul 25 2015

Extensions

Offset corrected to 1 and minor edits by M. F. Hasler, Jul 25 2015

A163292 a(n) = n-th prime minus (number of digits of n-th prime written in base 4).

Original entry on oeis.org

1, 2, 3, 5, 9, 11, 14, 16, 20, 26, 28, 34, 38, 40, 44, 50, 56, 58, 63, 67, 69, 75, 79, 85, 93, 97, 99, 103, 105, 109, 123, 127, 133, 135, 145, 147, 153, 159, 163, 169, 175, 177, 187, 189, 193, 195, 207, 219, 223, 225, 229, 235, 237, 247, 252, 258, 264, 266, 272, 276
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 24 2009

Keywords

Examples

			a(6) = 11 (= 13 - 2);
a(7) = 14 (= 17 - 3); ...
a(54) = 247 (= 251 - 4);
a(55) = 252 (= 257 - 5).
		

Crossrefs

Cf. A000040, A004678, A163291, A163293 (analog in base 2).

Programs

Formula

a(n) = A000040(n) - A163291(n).

A359840 Numbers k that are the representation of primes in base 4 and in base 5.

Original entry on oeis.org

2, 3, 23, 131, 133, 221, 1211, 1231, 2023, 2111, 2113, 2311, 3013, 3211, 3233, 3323, 10031, 10033, 10121, 12011, 12121, 13223, 13331, 20131, 20203, 22111, 23233, 31313, 32033, 32303, 33133, 33331, 100123, 100211, 100231, 101003, 101333, 103333, 110021, 111211
Offset: 1

Views

Author

Bernard Schott, Jan 15 2023

Keywords

Comments

For a(1) = 2, 2_4 = 2_5 = 2_10 and for a(2) = 3, 3_4 = 3_5 = 3_10; otherwise, these two primes are distinct for n >= 3 (example).
The corresponding sequences of primes are A235474 (for base 4) and A235615 (for base 5).

Examples

			a(3) = 23 because 23_4 = 11_10 = A235474(3) and 23_5 = 13_10 = A235615(3) are primes.
a(9) = 2023 because 2023_4 = 139_10 = A235474(9) and 2023_5 = 263_10 = A235615(9) are primes.
		

Crossrefs

Intersection of A004678 and A004679.

Programs

  • Mathematica
    q[n_, b_] := Max[d = IntegerDigits[n]] < b && PrimeQ[FromDigits[d, b]]; Select[Range[200000], q[#, 4] && q[#, 5] &] (* Amiram Eldar, Jan 15 2023 *)
  • Python
    from sympy import isprime
    def ok(n): return max(s:=str(n)) < '4' and isprime(int(s, 4)) and isprime(int(s, 5))
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jan 15 2023
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): yield from (int(s) for d in count(1) for f in "123" for r in product("0123", repeat=d-1) if isprime(int(s:=f+"".join(r), 4)) and isprime(int(s, 5)))
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jan 15 2023

Formula

a(n) = A007090(A235474(n)); a(n) = A007091(A235615(n)).

Extensions

More terms from Amiram Eldar, Jan 15 2023
Showing 1-8 of 8 results.