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

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

A180557 Primes that become a different prime under the mapping 6 <=> 9.

Original entry on oeis.org

67, 97, 163, 167, 193, 197, 263, 293, 367, 397, 461, 491, 563, 593, 607, 641, 647, 653, 661, 677, 683, 907, 941, 947, 953, 977, 983, 991, 1061, 1063, 1091, 1093, 1163, 1193, 1567, 1597, 1601, 1607, 1613, 1663, 1667, 1901, 1907, 1913, 1993, 1997, 2267, 2297
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, 6] || MemberQ[id, 9]) && PrimeQ[ FromDigits[ id /. {6 -> 9, 9 -> 6}] ]]; Select[ Prime@ Range@ 350, fQ]

A088999 Flip 6,9 numbers: if number k contains decimal digit '6' or '9', then flip all occurrences of '6' to '9' and vice versa.

Original entry on oeis.org

9, 6, 19, 16, 29, 26, 39, 36, 49, 46, 59, 56, 90, 91, 92, 93, 94, 95, 99, 97, 98, 96, 79, 76, 89, 86, 60, 61, 62, 63, 64, 65, 69, 67, 68, 66, 109, 106, 119, 116, 129, 126, 139, 136, 149, 146, 159, 156, 190, 191, 192, 193, 194, 195, 199, 197, 198, 196, 179, 176, 189
Offset: 1

Views

Author

Cino Hilliard, Nov 02 2003

Keywords

Comments

For digits d of n if d = 6 make it 9 else if d = 9 make it 6.
However, numbers containing neither digit 6 nor 9 are not terms (cf. A222251).

Crossrefs

Programs

  • PARI
    flip69(n) = { for(x=1,n, y=x; v=0; f=0; ln =length(Str(x)); a = vector(ln); forstep(j=ln,1,-1, r = y%10; a[j]=r; if(r==6,a[j] = 9; f=1); if(r==9,a[j] = 6; f=1); y = floor(y/10); ); forstep(j=ln,1,-1, v=v+a[j]*10^(ln-j) ); if(f,print1(v",")); ) }
    
  • Python
    def has69(s): return '6' in s or '9' in s
    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)) if has69(s)]
    print(aupto(186)) # Michael S. Branicky, Sep 06 2021
Showing 1-3 of 3 results.