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.

A090707 Primes whose decimal representation is a valid number in base 4 and interpreted as such is again a prime.

Original entry on oeis.org

2, 3, 11, 13, 23, 31, 101, 103, 113, 131, 211, 223, 233, 311, 331, 1013, 1021, 1033, 1103, 1201, 1213, 1223, 1231, 1301, 2003, 2111, 2113, 2131, 2203, 2213, 2311, 2333, 3001, 3011, 3203, 3221, 3301, 3323, 10111, 10211, 10303, 10313, 10321, 10331
Offset: 1

Views

Author

Cino Hilliard, Jan 18 2004

Keywords

Examples

			13 is prime in decimal and also when considered as a number in base 4: 13 [base 4] = 7 [base 10] which is also prime.
		

Crossrefs

Programs

  • Mathematica
    Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 4], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
    FromDigits[#,10]&/@Select[Tuples[{0,1,2,3},5],AllTrue[{FromDigits[#,4],FromDigits[#,10]},PrimeQ]&] (* Harvey P. Dale, Jul 30 2021 *)
  • PARI
    forprime(p=2,1e4, if(isprime(t=fromdigits(digits(p,4))), print1(t", "))) \\ Charles R Greathouse IV, Apr 22 2015

Extensions

Name, example and offset corrected by M. F. Hasler, Jan 03 2014

A089971 Primes whose decimal representation also represents a prime in base 2.

Original entry on oeis.org

11, 101, 10111, 101111, 1011001, 1100101, 10010101, 10011101, 10100011, 10101101, 10110011, 11000111, 11100101, 100111001, 101001011, 101101111, 101111011, 101111111, 110111011, 111001001, 1000001011, 1001001011, 1001110111, 1010000011, 1010000111, 1010001101
Offset: 1

Views

Author

Cino Hilliard, Jan 18 2004

Keywords

Comments

See A065720 for the primes given by these terms considered as numbers written in base 2, i.e., the sequence with the definition "working in the opposite sense". - M. F. Hasler, Jan 05 2014
A subsequence of A020449. - M. F. Hasler, Jan 11 2014

Examples

			a(1)=11 is a prime and its decimal representation is also a valid base-2 representation (because all digits are < 2), and 11_2 = 3_10 is again a prime.
		

Crossrefs

Cf. A031974, A089981, A090707, A090708, A090709, A090710, A235394, A235395, A000040 and references therein.

Programs

  • Mathematica
    Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 2], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
  • PARI
    is_A089971(p)=vecmax(d=digits(p))<2&&isprime(vector(#d, i, 2^(#d-i))*d~)&&isprime(p) \\ "d" is implicitly declared local. Putting isprime(p) to the end improves performance when the function is applied to primes only or to very large numbers. - M. F. Hasler, Jan 05 2014
    
  • PARI
    fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
    list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 2), if(isprime(t=fromdigits(digits(p, 2), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
    
  • Python
    from sympy import isprime, primerange
    def aupto(limit):
        alst = []
        for p in primerange(2, limit+1):
            t = int(bin(p)[2:])
            if isprime(t): alst.append(t)
        return alst
    print(aupto(2**11)) # Michael S. Branicky, Aug 19 2021

Extensions

Definition and example reworded, offset corrected, and cross-references added by M. F. Hasler, Jan 05 2014

A089981 Primes whose decimal representation also represents a prime in base 3.

Original entry on oeis.org

2, 2111, 2221, 10211, 12011, 12211, 20201, 21011, 21101, 21211, 22111, 101021, 101111, 102101, 102121, 110221, 111121, 111211, 120011, 120121, 121001, 121021, 122011, 201101, 202001, 202021, 210011, 210101, 1000211, 1010201, 1012201
Offset: 1

Views

Author

Cino Hilliard, Jan 18 2004

Keywords

Comments

See A065721 for the primes given by these terms considered as numbers written in base 3, i.e., the sequence with the definition "working in the opposite sense". - M. F. Hasler, Jan 05 2014

Examples

			2111 is a prime and its decimal representation is also a valid base-3 representation (because all digits are < 3), and 2111[3] = 67[10] is again a prime. Therefore 2111 is in the sequence.
		

Crossrefs

Cf. A031974, A089971, A090707, A090708, A090709, A090710, A235394, A235395, A000040 and further references therein.

Programs

  • Mathematica
    Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 3], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
    FromDigits/@Select[Tuples[{0,1,2},7],AllTrue[{FromDigits[#],FromDigits[ #,3]},PrimeQ]&] (* Harvey P. Dale, Aug 15 2022 *)
  • PARI
    is_A089981(p)=vecmax(d=digits(p))<3&&isprime(vector(#d,i,3^(#d-i))*d~)&&isprime(p) \\ "d" is implicitly declared local. Putting isprime(p) to the end improves performance when the function is applied to primes only, as below, or to very large numbers. - M. F. Hasler, Jan 05 2014
    
  • PARI
    forprime(p=2,1e6,is_A089981(p)&&print1(p",")) \\ - M. F. Hasler, Jan 05 2014
    
  • PARI
    fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
    list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 3), if(isprime(t=fromdigits(digits(p, 3), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016

Extensions

Definition and example reworded, offset corrected and cross-references added by M. F. Hasler, Jan 05 2014

A235394 Primes whose decimal representation is a valid number in base 8 and interpreted as such is again a prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 23, 37, 53, 73, 103, 107, 131, 211, 227, 263, 277, 307, 337, 373, 401, 431, 433, 463, 467, 521, 541, 547, 557, 577, 631, 643, 661, 673, 701, 1013, 1063, 1151, 1153, 1201, 1223, 1327, 1423, 1451, 1453, 1531, 1567, 1613, 1627, 1663, 1721, 2011, 2017
Offset: 1

Views

Author

Robert G. Wilson v, Jan 09 2014

Keywords

Examples

			a(5) = 13_10 = prime(5), 13_8 = 3 + 1*8 = 11_10 = prime(4).
a(8) = 53_10 = prime(16), 53_8 = 3 + 5*8 = 43_10 = prime(14). - _Marius A. Burtea_, Jun 30 2019
		

Crossrefs

Programs

  • Magma
    [n:n in PrimesUpTo(2100)| Max(Intseq(n,10)) le 7 and IsPrime(Seqint(Intseq(Seqint(Intseq(n),8))))]; // Marius A. Burtea, Jun 30 2019
  • Mathematica
    Select[FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 8], PrimeQ]
  • PARI
    fixBase(n,oldBase,newBase)=my(d=digits(n,oldBase),t=newBase-1); for(i=1,#d, if(d[i]>t, for(j=i,#d, d[j]=t); break)); fromdigits(d,newBase)
    list(lim)=my(v=List(),t); forprime(p=2,fixBase(lim\1,10,8), if(isprime(t=fromdigits(digits(p,8),10)), listput(v,t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
    

A235395 Primes whose decimal representation is a valid number in base 9 and interpreted as such is again a prime.

Original entry on oeis.org

2, 3, 5, 7, 41, 47, 67, 131, 151, 241, 331, 337, 461, 557, 601, 641, 661, 751, 757, 827, 887, 1031, 1181, 1217, 1231, 1321, 1327, 1367, 1471, 1637, 1877, 2027, 2081, 2111, 2131, 2207, 2281, 2287, 2351, 2357, 2647, 2731, 2861, 3037, 3121, 3181, 3187, 3307, 3347
Offset: 1

Views

Author

Robert G. Wilson v, Jan 09 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Select[FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 9], PrimeQ]
  • PARI
    fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
    list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 9), if(isprime(t=fromdigits(digits(p, 9), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016

A090709 Primes whose decimal representation is a valid number in base 6 and interpreted as such is again a prime.

Original entry on oeis.org

2, 3, 5, 11, 31, 101, 151, 211, 241, 251, 331, 421, 431, 521, 1021, 1151, 1231, 1321, 2011, 2131, 2311, 2351, 2441, 2531, 2551, 3041, 3221, 3251, 3301, 3541, 4021, 4111, 4201, 4421, 4441, 4451, 5011, 5021, 5101, 5231, 5441, 5531, 10331, 11131, 11311
Offset: 1

Views

Author

Cino Hilliard, Jan 18 2004

Keywords

Examples

			31 is prime in decimal and a valid number in base 6: 31_6 = 19, a prime.
		

Crossrefs

Programs

  • Magma
    [n:n in PrimesUpTo(12000)| Max(Intseq(n,10)) le 5 and IsPrime(Seqint(Intseq(Seqint(Intseq(n),6))))]; // Marius A. Burtea, Jun 30 2019
  • Mathematica
    Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 6], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
    vn6pQ[n_]:=Module[{idn=IntegerDigits[n]},Max[idn]<6&&PrimeQ[ FromDigits[ idn,6]]]; Select[Prime[Range[1500]],vn6pQ] (* Harvey P. Dale, Jul 10 2015 *)
  • PARI
    fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
    list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 6), if(isprime(t=fromdigits(digits(p, 6), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
    
  • Python
    from gmpy2 import digits, is_prime
    A090709_list = [n for n in (int(digits(d,6)) for d in range(10**6) if is_prime(d)) if is_prime(n)] # Chai Wah Wu, Apr 09 2016
    

Extensions

Following suggestions by V.J. Pohjola and Donovan Johnson, name, example and offset corrected by M. F. Hasler, Jan 03 2014

A090708 Primes whose decimal representation is a valid number in base 5 and interpreted as such is again a prime.

Original entry on oeis.org

2, 3, 23, 43, 131, 241, 313, 401, 1123, 1231, 1321, 2111, 2113, 2221, 2311, 3323, 4003, 4241, 4423, 10103, 10301, 10433, 11243, 11423, 12011, 12413, 13331, 14323, 14411, 20113, 20201, 20443, 21011, 21143, 21341, 21433, 22111, 22133, 22441, 23431, 24113, 24421, 24443, 30211, 31223
Offset: 1

Views

Author

Cino Hilliard, Jan 18 2004

Keywords

Examples

			23 is prime when read as base-10 number and also when read as base-5 number, 23 [base 5] = 13 [base 10].
		

Crossrefs

Programs

  • Magma
    [n:n in PrimesUpTo(32000)| Max(Intseq(n,10)) le 4 and IsPrime(Seqint(Intseq(Seqint(Intseq(n),5))))]; // Marius A. Burtea, Jun 30 2019
  • Mathematica
    Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 5], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
  • PARI
    fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
    list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 5), if(isprime(t=fromdigits(digits(p, 5), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
    

Extensions

Name, example and offset corrected by M. F. Hasler, Jan 03 2014
More terms from Alejandro J. Becerra Jr., Aug 13 2018

A241246 Primes p such that the decimal expansion of its base 7 expansion converted to decimal is a square.

Original entry on oeis.org

13, 19, 139, 313, 433, 571, 883, 1489, 3547, 10513, 11779, 14389, 20011, 25939, 27763, 30181, 32353, 42649, 44617, 45289, 46309, 47353, 48787, 55411, 65269, 65713, 96331, 111577, 120763, 129967, 151717, 157219, 201997, 216091, 281947, 292549, 322537, 339121, 373987, 397489, 420349, 432961, 460417, 475417, 478531, 506563, 582433, 591739, 599479, 753229, 778357, 857821, 861139, 887947, 968419, 1037089, 1062361, 1213651, 1246249
Offset: 1

Views

Author

Zak Seidov, Apr 18 2014

Keywords

Comments

No terms are 0, 2, or 3 mod 7. - Charles R Greathouse IV, Apr 18 2014

Examples

			{13,19,139,313,433,571,883,1489,3547,10513,11779}_10 =
{16,25,256,625,1156,1444,2401,4225,13225,42436,46225}_7 =
{4,5,16,25,34,38,49,65,115,206,215}^2_10.
		

Crossrefs

Programs

  • PARI
    is(n)=issquare(subst(Pol(digits(n,7)),'x,10)) && isprime(n) \\ Charles R Greathouse IV, Apr 18 2014
    
  • PARI
    for(n=4,1e3,if(vecmax(v=digits(n^2))<7 && isprime(p= subst(Pol(v), 'x, 7)), print1(p", "))) \\ Charles R Greathouse IV, Apr 18 2014
Showing 1-8 of 8 results.