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-10 of 47 results. Next

A175789 Primes that become another prime under the map 8 <-> 9 (acting on the decimal digits).

Original entry on oeis.org

181, 191, 283, 293, 787, 797, 811, 853, 877, 881, 887, 911, 953, 977, 991, 997, 1087, 1097, 1483, 1493, 1801, 1831, 1873, 1901, 1931, 1973, 2287, 2297, 2383, 2393, 2683, 2693, 2803, 2857, 2903, 2957, 3181, 3191, 3583, 3593, 3823, 3847, 3923, 3947, 4483
Offset: 1

Views

Author

Zak Seidov, Sep 05 2010

Keywords

Examples

			283 is in the sequence because changing the 8 to a 9 it becomes 293, a different prime. Likewise 293 is also in the sequence.
383 is not in the sequence because changing the 8 to a 9 it becomes 393, which is thrice 131.
		

Crossrefs

Cf. A171057.

Programs

  • Maple
    N:= 1000000: # to get all entries <= N
    F:= proc(n) local L,R,i;
      if not isprime(n) then return false end if;
      L:= convert(n,base,10);
      R:= subs([8=9,9=8],L);
      if R = L then return false end if;
      isprime(add(R[i]*10^(i-1),i=1..nops(R)))
    end proc:
    select(F, [seq(2*i+1,i=1..floor((N-1)/2))]);
    # Robert Israel, Feb 11 2013
  • Mathematica
    Reap[Do[p = Prime[n]; id = IntegerDigits[p]; id2 = id /. {9 -> 8, 8 -> 9}; If[PrimeQ[fd = FromDigits[id2]]&& fd != p, Sow[p]], {n, 2000}]][[2, 1]]; (* Seidov, corrected by Wouter Meeussen, Feb 10 2013 *)
    fQ[n_] := Block[{id = IntegerDigits@n}, (MemberQ[id, 8] || MemberQ[id, 9]) && PrimeQ[ FromDigits[id /. {8 -> 9, 9 -> 8}] ]]; Select[ Prime@ Range@ 609, fQ] (* Robert G. Wilson v, Sep 06 2010 *)
  • PARI
    is_A175789(n)={my(d=digits(n)); d != (d=apply(t->bitxor(t,t>7),d)) & isprime( sum(i=1, #d, d[i]*10^(#d-i))) & isprime(n)} \\ - M. F. Hasler, Feb 11 2013

A175791 Primes that become another prime under the map 1 <-> 0 (acting on the digits: A222210), cf. A171013.

Original entry on oeis.org

13, 17, 103, 107, 109, 113, 137, 167, 173, 179, 197, 307, 317, 409, 419, 607, 617, 709, 719, 1013, 1019, 1039, 1049, 1063, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1153, 1223, 1229, 1277, 1283, 1303, 1307, 1367, 1373, 1409, 1433, 1439, 1487, 1499, 1523
Offset: 1

Views

Author

Zak Seidov, Sep 06 2010

Keywords

Examples

			13 => 3, 17 => 7, 107 => 17, 113 => 3.
		

Crossrefs

Programs

  • Mathematica
    Reap[Do[p=Prime[n];id=IntegerDigits[p]; id2=id/.{1->0,0->1};If[PrimeQ[fd=FromDigits[id2]]&&fd != p,Sow[p]],{n,2000}]][[2,1]];
    fQ[n_] := Block[{id = IntegerDigits@n}, (MemberQ[id, 0] || MemberQ[id, 1]) && PrimeQ[ FromDigits[id /. {0 -> 1, 1 -> 0}]]]; Select[ Prime@ Range@ 250, fQ] (* Robert G. Wilson v, Sep 06 2010 *)
  • PARI
    {my(q); forprime(p=1,599, p!=(q=A222210(p)) && isprime(q) && isprime(p) && print1(p, ", "))} \\ M. F. Hasler, Feb 13 2013

A171013 In the sequence of prime numbers, replace all digits '1' with '0' and vice versa.

Original entry on oeis.org

2, 3, 5, 7, 0, 3, 7, 9, 23, 29, 30, 37, 40, 43, 47, 53, 59, 60, 67, 70, 73, 79, 83, 89, 97, 10, 13, 17, 19, 3, 27, 30, 37, 39, 49, 50, 57, 63, 67, 73, 79, 80, 90, 93, 97, 99, 200, 223, 227, 229, 233, 239, 240, 250, 257, 263, 269, 270, 277, 280, 283, 293, 317
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    FromDigits[IntegerDigits[#]/.{1->p,0->q}/.{p->0,q->1}]&/@Prime[Range[100]] (* Vincenzo Librandi, Jul 06 2012 *)
  • PARI
    a(n)=my(v=[1,0,2,3,4,5,6,7,8,9]);apply(k->v[k+1],digits(prime(n))) \\ Charles R Greathouse IV, Jul 16 2013

Formula

a(n) = A222210(A000040(n)). - M. F. Hasler, Feb 13 2013

A175770 In the sequence of prime numbers, replace all the '3' digits with '1' and vice versa.

Original entry on oeis.org

2, 1, 5, 7, 33, 31, 37, 39, 21, 29, 13, 17, 43, 41, 47, 51, 59, 63, 67, 73, 71, 79, 81, 89, 97, 303, 301, 307, 309, 331, 327, 313, 317, 319, 349, 353, 357, 361, 367, 371, 379, 383, 393, 391, 397, 399, 233, 221, 227, 229, 211, 219, 243, 253, 257, 261, 269, 273, 277
Offset: 1

Views

Author

Vincenzo Librandi, Sep 01 2010

Keywords

Crossrefs

Cf. A000040 (the prime numbers), A171013-A171016, A171018-A171057.

Programs

  • Mathematica
    FromDigits[IntegerDigits[#]/.{3->p, 1->q}/.{p->1, q->3}]&/@Prime[Range[60]] (* Vincenzo Librandi, Jul 29 2013 *)
  • PARI
    a(n)=my(v=[0,3,2,1,4,5,6,7,8,9]);apply(k->v[k+1],digits(prime(n))) \\ Charles R Greathouse IV, Jul 16 2013
    
  • Python
    from sympy import prime
    def a(n):
      return int(str(prime(n)).translate({ord('1'):ord('3'), ord('3'):ord('1')}))
    print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Feb 01 2021

Extensions

Corrected by D. S. McNeil and R. J. Mathar, Sep 02 2010

A222254 In the number n, replace all (decimal) digits '8' with '9' and vice versa.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 8, 10, 11, 12, 13, 14, 15, 16, 17, 19, 18, 20, 21, 22, 23, 24, 25, 26, 27, 29, 28, 30, 31, 32, 33, 34, 35, 36, 37, 39, 38, 40, 41, 42, 43, 44, 45, 46, 47, 49, 48, 50, 51, 52, 53, 54, 55, 56, 57, 59, 58, 60, 61, 62, 63, 64, 65, 66, 67, 69, 68, 70, 71, 72, 73, 74, 75
Offset: 0

Views

Author

M. F. Hasler, Feb 13 2013

Keywords

Comments

The map which is applied to primes in A171057.

Crossrefs

Programs

  • Mathematica
    a[n_]:= IntegerDigits[n]/.{8->9, 9->8}//FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 29 2013 *)
  • PARI
    A222254(n,d=[0, 1, 2, 3, 4, 5, 6, 7, 9, 8])=sum(i=1,#n=digits(n),d[n[i]+1]*10^(#n-i),!n*d[1]) \\ N.B.: digits(0)=[] in PARI (v.2.6)

A035043 Replace any decimal digit '1' with '2' and vice versa.

Original entry on oeis.org

0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 20, 22, 21, 23, 24, 25, 26, 27, 28, 29, 10, 12, 11, 13, 14, 15, 16, 17, 18, 19, 30, 32, 31, 33, 34, 35, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 46, 47, 48, 49, 50, 52, 51, 53, 54, 55, 56, 57, 58, 59, 60, 62, 61, 63, 64, 65, 66, 67, 68
Offset: 0

Views

Author

Keywords

Comments

The map which is applied to primes in A171015. - M. F. Hasler, Feb 12 2013

Crossrefs

Programs

  • Mathematica
    a[n_]:= IntegerDigits[n]/.{1->2, 2->1} // FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 29 2013 *)
  • PARI
    A035043(n, d=[0, 2, 1, 3, 4, 5, 6, 7, 8, 9])=sum(i=1, #n=digits(n), d[n[i]+1]*10^(#n-i)) \\ gives correct value for n=0 iff d[1]=0, since digits(0)=[] in PARI (v.2.6) M. F. Hasler, Feb 12 2013

Extensions

Definition rephrased by M. F. Hasler, Oct 26 2013

A222235 In the number n, replace all (decimal) digits '3' with '5' and vice versa.

Original entry on oeis.org

0, 1, 2, 5, 4, 3, 6, 7, 8, 9, 10, 11, 12, 15, 14, 13, 16, 17, 18, 19, 20, 21, 22, 25, 24, 23, 26, 27, 28, 29, 50, 51, 52, 55, 54, 53, 56, 57, 58, 59, 40, 41, 42, 45, 44, 43, 46, 47, 48, 49, 30, 31, 32, 35, 34, 33, 36, 37, 38, 39, 60, 61, 62, 65, 64, 63, 66, 67, 68, 69, 70, 71, 72, 75, 74, 73
Offset: 0

Views

Author

M. F. Hasler, Feb 12 2013

Keywords

Comments

The map which is applied to primes in A171026.

Crossrefs

Programs

  • Mathematica
    a[n_]:= IntegerDigits[n]/.{3->5, 5->3} // FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 30 2013 *)
  • PARI
    A222235(n,d=[0,1,2,5,4,3,6,7,8,9])={sum(i=1,#n=digits(n),d[n[i]+1]*10^(#n-i),!n*d[1])} \\ N.B.: digits(0)=[] in PARI (v.2.6)

A222251 In the number n, replace all (decimal) digits '6' with '9' and vice versa.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 9, 7, 8, 6, 10, 11, 12, 13, 14, 15, 19, 17, 18, 16, 20, 21, 22, 23, 24, 25, 29, 27, 28, 26, 30, 31, 32, 33, 34, 35, 39, 37, 38, 36, 40, 41, 42, 43, 44, 45, 49, 47, 48, 46, 50, 51, 52, 53, 54, 55, 59, 57, 58, 56, 90, 91, 92, 93, 94, 95, 99, 97, 98, 96, 70, 71, 72, 73, 74, 75
Offset: 0

Views

Author

M. F. Hasler, Feb 13 2013

Keywords

Comments

The map which is applied to primes in A171055.

Crossrefs

Programs

  • Mathematica
    a[n_]:= IntegerDigits[n]/.{6->9, 9->6} // FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 31 2013 *)
  • PARI
    A222251(n,d=[0, 1, 2, 3, 4, 5, 9, 7, 8, 6])=sum(i=1,#n=digits(n),d[n[i]+1]*10^(#n-i),!n*d[1]) \\ N.B.: digits(0)=[] in PARI (v.2.6)
    
  • Python
    def flp69(s): return s.replace("6", "-").replace("9", "6").replace("-", "9")
    def aupto(lim): return [int(flp69(s)) for s in map(str, range(lim+1))]
    print(aupto(75)) # Michael S. Branicky, Sep 07 2021

A222211 In the number n, replace all (decimal) digits '0' with '2' and vice versa.

Original entry on oeis.org

2, 1, 0, 3, 4, 5, 6, 7, 8, 9, 12, 11, 10, 13, 14, 15, 16, 17, 18, 19, 2, 1, 0, 3, 4, 5, 6, 7, 8, 9, 32, 31, 30, 33, 34, 35, 36, 37, 38, 39, 42, 41, 40, 43, 44, 45, 46, 47, 48, 49, 52, 51, 50, 53, 54, 55, 56, 57, 58, 59, 62, 61, 60, 63, 64, 65, 66, 67, 68, 69, 72, 71, 70, 73, 74, 75
Offset: 0

Views

Author

M. F. Hasler, Feb 12 2013

Keywords

Comments

The map which is applied to primes in A171014.
Programs should omit leading '0' digits in the resulting terms. - Georg Fischer, Apr 06 2019

Crossrefs

Cf. A222210-A222254 (other digit pairs), A171013-A171057, A175770 (in prime numbers).

Programs

  • Mathematica
    a[n_]:= IntegerDigits[n]/.{0->2, 2->0} // FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 29 2013 *)
  • PARI
    A222211(n,d=[2,1,0,3,4,5,6,7,8,9])={sum(i=1,#n=digits(n),d[n[i]+1]*10^(#n-i),!n*d[1])} \\ N.B.: digits(0)=[] in PARI (v.2.6)
    
  • Perl
    print join(",", map{tr/02/20/; $+0}(0..75)); # _Georg Fischer, Apr 06 2019

A222212 In the number n, replace all (decimal) digits '0' with '3' and vice versa.

Original entry on oeis.org

3, 1, 2, 0, 4, 5, 6, 7, 8, 9, 13, 11, 12, 10, 14, 15, 16, 17, 18, 19, 23, 21, 22, 20, 24, 25, 26, 27, 28, 29, 3, 1, 2, 0, 4, 5, 6, 7, 8, 9, 43, 41, 42, 40, 44, 45, 46, 47, 48, 49, 53, 51, 52, 50, 54, 55, 56, 57, 58, 59, 63, 61, 62, 60, 64, 65, 66, 67, 68, 69, 73, 71, 72, 70, 74, 75
Offset: 0

Views

Author

M. F. Hasler, Feb 12 2013

Keywords

Comments

The map which is applied to primes in A171016.

Crossrefs

Programs

  • Mathematica
    a[n_]:= IntegerDigits[n]/.{0->3, 3->0} // FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 29 2013 *)
  • PARI
    A222212(n,d=[3,1,2,0,4,5,6,7,8,9])=sum(i=1,#n=digits(n),d[n[i]+1]*10^(#n-i))+!n*d[1] \\ N.B.: PARI's digits() function returns [] for 0.
    
  • PARI
    a(n)=if(n, fromdigits(apply(d->if(d>3,d,[3,1,2,0][d+1]), digits(n))), 3) \\ Charles R Greathouse IV, Sep 27 2015
Showing 1-10 of 47 results. Next