OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
MATHEMATICA
FromDigits[IntegerDigits[#]/.{2->p, 1->q}/.{p->1, q->2}]&/@Prime[Range[100]] (* Vincenzo Librandi, Mar 12 2013 *)
PROG
(PARI) a(n)=my(v=[0, 2, 1, 3, 4, 5, 6, 7, 8, 9]); subst(Pol(apply(k->v[k+1], digits(prime(n)))), 'x, 10) \\ Charles R Greathouse IV, Jul 16 2013
(Magma) [ Seqint([d eq 1 select 2 else d eq 2 select 1 else d : d in Intseq(NthPrime(i))]) : i in [1..100] ]; // Vincenzo Librandi, Sep 17 2025
(Python)
from sympy import prime
def a(n): return int(str(prime(n)).translate({49:50, 50:49}))
print([a(n) for n in range(1, 57)]) # Michael S. Branicky, Sep 17 2025
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane and Vincenzo Librandi, Sep 04 2010
STATUS
approved
