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

A180528 Primes that become a different prime under the mapping 1 <=> 5.

Original entry on oeis.org

13, 19, 53, 59, 103, 109, 163, 193, 199, 313, 353, 503, 509, 563, 593, 599, 613, 619, 653, 659, 1009, 1019, 1039, 1087, 1103, 1117, 1163, 1237, 1279, 1297, 1303, 1399, 1453, 1459, 1483, 1553, 1559, 1567, 1579, 1597, 1613, 1619, 1669, 1693, 1783, 1867
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, Sep 09 2010

Keywords

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{id = IntegerDigits@n}, (MemberQ[id, 1] || MemberQ[id, 5]) && PrimeQ[ FromDigits[ id /. {1 -> 5, 5 -> 1}] ]]; Select[ Prime@ Range@ 300, fQ]

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

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Feb 12 2013

Keywords

Comments

The map which is applied to primes in A171024.

Crossrefs

Programs

  • Haskell
    a222222 = foldl f 0 . map (read . return) . show :: Integer -> Integer
              where f v d = 10 * v + if d == 1 || d == 5 then 6 - d else d
    -- Reinhard Zumkeller, Jan 29 2014
  • Maple
    a:= proc(n) local m, d; d:=irem(n, 10, 'm');
         `if`(n=0, 0, parse(cat(a(m),`if`(d in [1, 5], 6-d, d))))
        end:
    seq(a(n), n=0..99);  # Alois P. Heinz, Mar 02 2013
  • Mathematica
    a[n_]:= IntegerDigits[n]/.{1->5, 5->1} // FromDigits; Table[a[n], {n, 0, 80}] (* Vincenzo Librandi, Jul 30 2013 *)
  • PARI
    A222222(n,d=[0,5,2,3,4,1,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)
    

Formula

Recurrence: a(10*n+i) = 10*a(n)+g(i) for 0 <= i <= 9, where
g(x) = -13/10080*x^9 +43/840*x^8 -611/720*x^7 +457/60*x^6 -57739/1440*x^5 +5007/40*x^4 -62231/280*x^3 +13941/70*x^2 -319/5*x. - Robert Israel, May 13 2014
Showing 1-2 of 2 results.