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

A161594 a(n) = R(f(n)), where R = A004086 = reverse (decimal) digits, f = A071786 = reverse digits of prime factors.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 21, 13, 41, 51, 61, 17, 81, 19, 2, 12, 22, 23, 42, 52, 26, 72, 82, 29, 3, 31, 23, 33, 241, 53, 63, 37, 281, 39, 4, 41, 24, 43, 44, 54, 46, 47, 84, 94, 5, 312, 421, 53, 45, 55, 65, 372, 481, 59, 6, 61, 62, 36, 46, 551, 66, 67, 482, 69, 7, 71, 27
Offset: 1

Views

Author

J. H. Conway & Tanya Khovanova, Jun 14 2009

Keywords

Comments

Might be called TITO(n), turning n inside out then turning outside in.
Here is the operation: take a number n and find its prime factors. Reverse the digits of every prime factor (for example, replace 17 by 71). Multiply the factors respecting multiplicities. For example, if the original number was 17^2*43^3, the new product will be 71^2*34^3. After that, reverse the resulting number.

Examples

			a(34) = 241, because 34 = 2*17, f(34) = 2*71 = 142, and reversing gives 241.
		

Crossrefs

Programs

  • Haskell
    a161594 = a004086 . a071786  -- Reinhard Zumkeller, Oct 14 2011
    
  • Maple
    read("transforms") ; A071786 := proc(n) local ifs,a,d ; ifs := ifactors(n)[2] ; a := 1 ; for d in ifs do a := a*digrev(op(1,d))^op(2,d) ; od: a ; end: A161594 := proc(n) digrev(A071786(n)) ; end: seq(A161594(n),n=1..80) ; # R. J. Mathar, Jun 16 2009
    # second Maple program:
    r:= n-> (s-> parse(cat(seq(s[-i], i=1..length(s)))))(""||n):
    a:= n-> r(mul(r(i[1])^i[2], i=ifactors(n)[2])):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jun 19 2017
  • Mathematica
    reversepower[{n_, k_}] := FromDigits[Reverse[IntegerDigits[n]]]^k f[n_] := FromDigits[ Reverse[IntegerDigits[Times @@ Map[reversepower, FactorInteger[n]]]]] Table[f[n], {n, 100}]
    Table[IntegerReverse[Times@@Flatten[Table[IntegerReverse[#[[1]]],#[[2]]]& /@FactorInteger[n]]],{n,100}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 21 2016 *)
  • PARI
    R=A004086; A161594(n)={n=factor(n);n[,1]=apply(R,n[,1]);R(factorback(n))} \\  M. F. Hasler, Jun 24 2009. Removed code for R here, see A004086 for most recent & efficient version. - M. F. Hasler, May 11 2015
    
  • Python
    from math import prod
    from sympy import factorint
    def f(n): return prod(int(str(p)[::-1])**e for p, e in factorint(n).items())
    def R(n): return int(str(n)[::-1])
    def a(n): return 1 if n == 1 else R(f(n))
    print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Mar 28 2022

Formula

a(p) = p, for prime p.
a(A161598(n)) <> A161598(n); a(A161597(n)) = A161597(n); A010051(a(A161600(n))) = 1.
From M. F. Hasler, Jun 25 2009: (Start)
a( p*10^k ) = p for any prime p.
Proof: if gcd( p, 2*5) = 1, then a( p * 10^k ) = R( R(p) * R(2)^k * R(5)^k ) = R( R(p) * 10^k ) = R(R(p)) = p;
if gcd(p, 2*5) = 2, then p=2 and a( p * 10^k ) = R( R(2)^(k+1) * R(5)^k ) = R( 2 * 10^k ) = 2 = p and mutatis mutandis for gcd(p, 2*5) = 5. (End)

Extensions

Simpler definition from R. J. Mathar, Jun 16 2009
Edited by N. J. A. Sloane, Jun 23 2009

A161597 Numbers such that TITO(n) = n, where TITO(n) = A161594(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 17, 19, 22, 23, 26, 29, 31, 33, 37, 39, 41, 43, 44, 46, 47, 53, 55, 59, 61, 62, 66, 67, 69, 71, 73, 77, 79, 82, 83, 86, 88, 89, 93, 97, 99, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 169, 173, 179
Offset: 1

Views

Author

J. H. Conway & Tanya Khovanova, Jun 14 2009

Keywords

Comments

TITO(p) = p, for any prime p.

Crossrefs

Complement of A161598; nonprimes: A161600.

Programs

  • Haskell
    a161597 n = a161597_list !! (n-1)
    a161597_list = filter (\x -> a161594 x == x) [1..]
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Mathematica
    reversepower[{n_, k_}] := FromDigits[Reverse[IntegerDigits[n]]]^k f[n_] := FromDigits[ Reverse[IntegerDigits[Times @@ Map[reversepower, FactorInteger[n]]]]] Select[Range[200], f[ # ] == # &]
  • PARI
    is(n)={n==A161594(n)} \\ M. F. Hasler, May 11 2015

Extensions

Edited by N. J. A. Sloane, Jun 23 2009
Offset corrected by Reinhard Zumkeller, Oct 14 2011

A161730 Palindromic numbers that are fixed points of the TITO operation (see A161594) and are not products of palindromic primes.

Original entry on oeis.org

72927, 76167, 434434, 868868, 1226221, 4778774, 5703075, 8755578, 9386839, 13488431, 43877834, 123848321, 564414465, 777555777, 1072772701, 1946776491, 9935115399, 12467976421, 52854045825, 74663436647, 83361616338, 95829592859
Offset: 1

Views

Author

Tanya Khovanova, Jun 17 2009

Keywords

Comments

The numbers in this sequence are palindromic numbers that are fixed points of the TITO operation and are not primes and are not in A046351.

Crossrefs

Programs

  • Mathematica
    reversepower[{n_, k_}] := FromDigits[Reverse[IntegerDigits[n]]]^k f[n_] := FromDigits[ Reverse[IntegerDigits[Times @@ Map[reversepower, FactorInteger[n]]]]] rev[n_] := FromDigits[Reverse[IntegerDigits[n]]] Select[Range[5000000], rev[ # ] == # && ! PrimeQ[ # ] && f[ # ] == # && Map[rev, Transpose[FactorInteger[ # ]][[1]]] != Transpose[FactorInteger[ # ]][[1]] &]
  • PARI
    for( d=1,19, my(p=10^((d+1)\2),q=10^(d%2)); for( i=p\10,p-1, my(n = i\q*p+R(i),f); A161594(n)==n || next; apply(R,f=factor(n)[,1])==f && next; print1(n",") )) /* uses definitions given in A161594 */ \\ M. F. Hasler, Jun 25 2009

Extensions

Edited by N. J. A. Sloane, Jun 23 2009
Terms beyond a(6) from M. F. Hasler, Jun 25 2009

A161721 Primes p such that the reversal of p is prime and the product of p with its reversal is a palindrome.

Original entry on oeis.org

2, 3, 11, 101, 1021, 1201, 111211, 112111, 1000211, 1010201, 1020101, 1101211, 1102111, 1111021, 1112011, 1120001, 1121011, 1201111, 10011101, 10012001, 10021001, 10100201, 10111001, 10200101, 11012011, 11021011, 11100121, 12100111
Offset: 1

Views

Author

Tanya Khovanova, Jun 17 2009

Keywords

Comments

This sequence is a subsequence of A062936. If you multiply a member of this sequence by its reversal you get a number fixed under TITO algorithm (see A161594).
Conjecture: except for a(2) which equals 3, all terms can only be composed of the digits 0, 1 or 2. - Chai Wah Wu, Jan 07 2015
Conjecture: the digit 2 can only appear once in each term. - Robert G. Wilson v, Jan 07 2015
Number of terms less than 10^n: 2, 3, 4, 6, 6, 8, 18, 28, 37, 65, 97, 153, 230, 304, 414, 556, 756, 960, 1255, ... - Robert G. Wilson v, Jan 07 2015
A proper subset of A007500. - Robert G. Wilson v, Jan 07 2015

Examples

			1021 is a prime number, its reversal is 1201, which is also a prime. The product 1021*1201 = 1226221 is a palindrome.
		

Crossrefs

Programs

  • Maple
    rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: a := proc (n) local p: p := ithprime(n): if isprime(rev(p)) = true and rev(p*rev(p)) = p*rev(p) then p else end if end proc: seq(a(n), n = 1 .. 800000); # Emeric Deutsch, Jun 26 2009
  • Mathematica
    rev[n_]:=FromDigits[Reverse[IntegerDigits[n]]]; t={}; Do[p=Prime[n]; If[PrimeQ[q=rev[p]] && rev[p*q]==p*q, AppendTo[t,p]], {n,8*10^5}]; t (* Jayanta Basu, May 11 2013 *)
  • Python
    from sympy import isprime
    A161721_list = [2]
    for i in range(3,10**6,2):
        j = int(str(i)[::-1])
        if j == i:
            s = str(i**2)
            if s == s[::-1] and isprime(i):
                A161721_list.append(i)
        elif j > i:
            s = str(i*j)
            if s == s[::-1] and isprime(i) and isprime(j):
                A161721_list.extend([i,j])
    A161721_list = sorted(A161721_list) # Chai Wah Wu, Jan 07 2015

Extensions

Edited by N. J. A. Sloane, Jun 23 2009
More terms from Emeric Deutsch, Jun 26 2009

A161732 Fixed points of the TITO operation (A161594) that are also composite palindromes.

Original entry on oeis.org

4, 6, 8, 9, 22, 33, 44, 55, 66, 77, 88, 99, 121, 202, 242, 252, 262, 303, 343, 363, 393, 404, 484, 505, 525, 606, 616, 626, 686, 707, 808, 909, 939, 1111, 1331, 1441, 1661, 1991, 2112, 2222, 2662, 2772, 2882, 3333, 3443, 3773, 3883, 3993, 4224, 4444, 5445
Offset: 1

Views

Author

Tanya Khovanova, Jun 17 2009

Keywords

Comments

This sequence is a proper superset of A046351 (palindromic composite numbers with only palindromic prime factors). The smallest number that doesn't belong to A046351 is 72927. The numbers that are in this sequence and are not in A046351 are given in A161730.

Crossrefs

Programs

  • Mathematica
    reversepower[{n_, k_}] := FromDigits[Reverse[IntegerDigits[n]]]^k f[n_] := FromDigits[ Reverse[IntegerDigits[Times @@ Map[reversepower, FactorInteger[n]]]]] rev[n_] := FromDigits[Reverse[IntegerDigits[n]]] Select[Range[10000], f[ # ] == # && rev[ # ] == # && ! PrimeQ[ # ] &]

Extensions

Edited by N. J. A. Sloane, Jun 23 2009

A257842 Semiprimes p*q such that R(p*q) = R(p)*R(q), where R = A004086 = reverse digits.

Original entry on oeis.org

4, 6, 9, 22, 26, 33, 39, 46, 55, 62, 69, 77, 82, 86, 93, 121, 143, 169, 187, 202, 206, 226, 253, 262, 299, 303, 309, 339, 341, 393, 422, 446, 451, 466, 473, 482, 505, 583, 622, 626, 633, 662, 669, 671, 699, 707, 781, 802, 842, 862, 866, 886, 933, 939, 961
Offset: 1

Views

Author

M. F. Hasler, May 11 2015

Keywords

Comments

A subsequence of A161600. Almost all terms with less than 4 digits are either multiples of 2 or 3 or of 11.

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    digrev:= proc(n) local L,i;
    L:= convert(n,base,10);
    add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    F:= proc(p,q) if digrev(p*q)=digrev(p)*digrev(q) then p*q else NULL fi end proc:
    sort([seq(seq(F(Primes[i],q), q = select(`<=`,Primes[i..-1],N/Primes[i])), i=1..nops(Primes))]); # Robert Israel, May 14 2015
  • Mathematica
    f[n_]:=FactorInteger[n][[1,1]];g[n_]:=FromDigits[Reverse[IntegerDigits[n]]];Select[Range@1000,PrimeOmega[#]==2&&g[f[#]*#/f[#]]==g[f[#]]*g[#/f[#]]&] (* Ivan N. Ianakiev, May 14 2015 *)
  • PARI
    is(n)=bigomega(n)==2&&!eval(concat(Vecrev(Str(n"-"vecmin(n=factor(n)[,1])"*"vecmax(n)))))

A162151 Numbers n such that m=TITO(n)>n and TITO(m)=n, where TITO() = A161594().

Original entry on oeis.org

12, 18, 24, 27, 36, 45, 48, 132, 144, 156, 198, 264, 276, 288, 291, 297, 372, 375, 396, 405, 492, 495, 528, 576, 1089, 1212, 1236, 1287, 1356, 1359, 1452, 1572, 1584, 1629, 1683, 1728, 1812, 1818, 2002, 2067, 2079, 2178, 2304, 2424, 2532, 2676, 2721, 2727
Offset: 1

Views

Author

Zak Seidov, Jun 26 2009

Keywords

Comments

Or, numbers that end in two-cycles under TITO operation.

Examples

			For smaller n's, m is a reversal of n, but for larger n's, there are other cases as well:{12,21},{18,81},{24,42},{27,72},...,{291,732},...,{372,651}, etc.
		

Crossrefs

Formula

m=A161594(n)>n, and A161594(m)=n.
Showing 1-7 of 7 results.