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 12 results. Next

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

A151764 a(n) = f(f(n)), where f(n) = A071786(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 217, 20, 21, 22, 32, 24, 25, 26, 27, 28, 128, 30, 31, 32, 33, 34, 35, 36, 37, 434, 39, 40, 14, 42, 142, 44, 45, 64, 146, 48, 49, 50, 51, 52, 35, 54, 55, 56, 651, 256, 455, 60, 16, 62, 63, 64, 65, 66, 364, 68, 96, 70
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2009, Jun 23 2009

Keywords

Comments

Completely multiplicative.

Crossrefs

Cf. A071786.

Programs

A151765 a(n) = f(R(n)), where f(n) = A071786(n), R(n) = A004086(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 21, 13, 14, 213, 16, 17, 81, 217, 2, 12, 22, 32, 42, 124, 26, 72, 28, 128, 3, 31, 32, 33, 34, 35, 63, 37, 38, 39, 4, 14, 24, 142, 44, 54, 64, 146, 84, 148, 5, 15, 25, 35, 45, 55, 155, 75, 355, 455, 6, 16, 62, 36, 64, 56, 66, 364, 68, 96, 7, 71, 27
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2009

Keywords

Crossrefs

Programs

A151766 Records in A071786.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 31, 71, 91, 92, 142, 182, 213, 273, 284, 364, 455, 701, 901, 931, 941, 961, 971, 991, 1001, 1402, 1802, 2201, 2821, 5041, 6461, 8281, 8372, 10082, 12922, 16562, 19383, 24843, 25844, 27931, 33124, 41405, 49771, 63971, 81991, 84721
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2009

Keywords

Crossrefs

A151767 Where records occur in A071786.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 17, 19, 29, 34, 38, 51, 57, 68, 76, 95, 107, 109, 139, 149, 169, 179, 199, 209, 214, 218, 221, 247, 289, 323, 361, 551, 578, 646, 722, 969, 1083, 1292, 1417, 1444, 1805, 1819, 1853, 2071, 2641, 2831, 3211, 3401, 3638, 3706, 3757
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2009

Keywords

Crossrefs

A151768 Complement of A071786.

Original entry on oeis.org

19, 23, 29, 41, 43, 46, 47, 53, 57, 58, 59, 61, 67, 69, 82, 83, 86, 87, 89, 94, 103, 109, 115, 116, 122, 123, 127, 129, 137, 138, 139, 141, 159, 161, 163, 171, 173, 174, 177, 178, 183, 193, 197, 201, 203, 205, 206, 207, 209, 211, 215, 218, 223, 227, 229, 230
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2009

Keywords

Comments

A number n > 1 is in the sequence if and only if n/A004086(p) is in the sequence for all primes p with A004086(p) dividing n. [Hagen von Eitzen, Jun 23 2009]
A076056 is a subsequence. [Reinhard Zumkeller, Jul 06 2009]

Programs

  • Maple
    read("transforms") ; tdpr := proc(nd) local p,n ; p := [] ; for n from 1 do if ithprime(n) > 10^nd then break; else p := [op(p),digrev(ithprime(n))] ; fi; od: sort(p) ; end: A071786 := proc(L,nd) local tmp,tmp2,j,k,i ; tmp := [] ; for j from 0 do if op(1,L)^j > 10^nd then break; fi; tmp := [op(tmp),op(1,L)^j] ; od: for i from 2 to nops(L) do tmp2 := {} ; for k from 1 to nops(tmp) do for j from 0 do if op(k,tmp)*op(i,L)^j > 10^nd then break; fi; tmp2 := tmp2 union { op(k,tmp)*op(i,L)^j} ; od: od: tmp := convert(tmp2,list) ; od: tmp ; end: maxp10 := 3 : L := tdpr(maxp10) : a151768c := A071786(L,maxp10) : for n from 1 to 10^maxp10 do if not n in a151768c then printf("%d,",n) ; fi; od: # R. J. Mathar, Jun 24 2009
  • PARI
    A=Set([]);for(n=2,300,ok=0;fordiv(n,d,if(!setsearch(A,d)&&isprime(rev(n/d)),ok=1;break));if(!ok,print1(n,",");A=setunion(A,Set([n])))) \\ Hagen von Eitzen, Jun 23 2009

Extensions

More terms from Hagen von Eitzen and R. J. Mathar, Jun 23 2009

A376858 Fixed points of A071786.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 27, 28, 30, 32, 33, 35, 36, 40, 42, 44, 45, 48, 49, 50, 54, 55, 56, 60, 63, 64, 66, 70, 72, 75, 77, 80, 81, 84, 88, 90, 96, 98, 99, 100, 101, 105, 108, 110, 112, 120, 121, 125, 126, 128, 131, 132, 135, 140
Offset: 1

Views

Author

Paolo Xausa, Oct 07 2024

Keywords

Comments

First differs from A033620 at n = 139. In the present sequence a(139) = 403 = 13 * 31: 13 and 31 are the reversals of each other but neither is a palindrome, so 403 is not in A033620.

Crossrefs

Cf. A071786. Supersequence of A033620.

Programs

  • Mathematica
    A376858Q[k_] := k == Times @@ (IntegerReverse[#1]^#2 & @@@ FactorInteger[k]);
    Select[Range[200], A376858Q]

A007500 Primes whose reversal in base 10 is also prime (called "palindromic primes" by David Wells, although that name usually refers to A002385). Also called reversible primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 107, 113, 131, 149, 151, 157, 167, 179, 181, 191, 199, 311, 313, 337, 347, 353, 359, 373, 383, 389, 701, 709, 727, 733, 739, 743, 751, 757, 761, 769, 787, 797, 907, 919, 929, 937, 941, 953, 967, 971, 983, 991, 1009, 1021
Offset: 1

Views

Author

Keywords

Comments

The numbers themselves need not be palindromes.
The range is a subset of the range of A071786. - Reinhard Zumkeller, Jul 06 2009
Number of terms less than 10^n: 4, 13, 56, 260, 1759, 11297, 82439, 618017, 4815213, 38434593, ..., . - Robert G. Wilson v, Jan 08 2015

References

  • Roozbeh Hazrat, Mathematica: A Problem-Centered Approach, Springer 2010, pp. 39, 131-132
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 134.

Crossrefs

Cf. A002385 (primes that are palindromes in base 10).
Equals A002385 union A006567.
Complement of A076056 with respect to A000040. [From Reinhard Zumkeller, Jul 06 2009]

Programs

  • Haskell
    a007500 n = a007500_list !! (n-1)
    a007500_list = filter ((== 1) . a010051 . a004086) a000040_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [ p: p in PrimesUpTo(1030) | IsPrime(Seqint(Reverse(Intseq(p)))) ];  // Bruno Berselli, Jul 08 2011
    
  • Maple
    revdigs:= proc(n)
    local L,nL,i;
    L:= convert(n,base,10);
    nL:= nops(L);
    add(L[i]*10^(nL-i),i=1..nL);
    end:
    Primes:= select(isprime,{2,seq(2*i+1,i=1..5*10^5)}):
    Primes intersect map(revdigs,Primes); # Robert Israel, Aug 14 2014
  • Mathematica
    Select[ Prime[ Range[ 168 ] ], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ # ] ] ] ]& ] (* Zak Seidov, corrected by T. D. Noe *)
    Select[Prime[Range[1000]],PrimeQ[IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 15 2016 *)
  • PARI
    is_A007500(n)={ isprime(n) & is_A095179(n)} \\ M. F. Hasler, Jan 13 2012
    
  • Python
    from sympy import prime, isprime
    A007500 = [prime(n) for n in range(1,10**6) if isprime(int(str(prime(n))[::-1]))] # Chai Wah Wu, Aug 14 2014
    
  • Python
    from gmpy2 import is_prime, mpz
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield from [2, 3, 5, 7]
        p = 11
        for digits in count(2):
            for first in "1379":
                for mid in product("0123456789", repeat=digits-2):
                    for last in "1379":
                        s = first + "".join(mid) + last
                        if is_prime(t:=mpz(s)) and is_prime(mpz(s[::-1])):
                            yield int(t)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 02 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 31 2000
Added further terms to the sequence Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 16 2009. Checked by N. J. A. Sloane, Jan 20 2009.
Third reference added by Harvey P. Dale, Oct 17 2011

A004087 Primes written backwards.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 71, 91, 32, 92, 13, 73, 14, 34, 74, 35, 95, 16, 76, 17, 37, 97, 38, 98, 79, 101, 301, 701, 901, 311, 721, 131, 731, 931, 941, 151, 751, 361, 761, 371, 971, 181, 191, 391, 791, 991, 112, 322, 722, 922, 332, 932, 142, 152, 752, 362, 962, 172
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000040.

Programs

  • Haskell
    a004087 n = a004087_list !! (n-1)
    a004087_list = map a004086 a000040_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [Seqint(Reverse(Intseq(NthPrime(n)))): n in [1..60]]; // Vincenzo Librandi, Jan 21 2016
    
  • Mathematica
    FromDigits[Reverse[IntegerDigits[#]]]&/@Prime[Range[100]] (* Vincenzo Librandi, Jul 05 2015 *)
  • Python
    from sympy import primerange
    print([int(str(p)[::-1]) for p in primerange(2, 272)]) # Michael S. Branicky, Jun 24 2022

Formula

a(n) = A004086(A000040(n)) = A000040(n) - A068396(n). - N. J. A. Sloane, Jun 29 2008
a(n) = A188649(A000040(n)). - Reinhard Zumkeller, Apr 11 2011
a(n) = A071786(A000040(n)). - Reinhard Zumkeller, Oct 14 2011

Extensions

More terms from Eric M. Schmidt, Apr 04 2014

A162742 Reverse digits in the binary representation of each prime base in the prime factorization of n.

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 13, 3, 11, 7, 15, 1, 17, 9, 25, 5, 21, 13, 29, 3, 25, 11, 27, 7, 23, 15, 31, 1, 39, 17, 35, 9, 41, 25, 33, 5, 37, 21, 53, 13, 45, 29, 61, 3, 49, 25, 51, 11, 43, 27, 65, 7, 75, 23, 55, 15, 47, 31, 63, 1, 55, 39, 97, 17, 87, 35, 113, 9, 73, 41, 75, 25, 91, 33
Offset: 1

Views

Author

R. J. Mathar, Jul 12 2009

Keywords

Comments

Base-2 variant of A071786: apply the bit-reversion A030101 to each of the primes in the bases of the prime factorization of n.

Examples

			At n=8=2^3, represent 2 as 10 in binary, reverse 10 to give 1, and recombine as 1^3=1 = a(8). At n=14=2*7 =(10)*(111) in binary, reverse the factors to give (1)*(111)=1*7=7=a(14).
		

Crossrefs

Cf. A030101, A071786, A161955, A376857 (fixed points).

Programs

  • Maple
    A030101 := proc(n) local dgs ; dgs := convert(n,base,2) ; add( op(-i,dgs)*2^(i-1),i=1..nops(dgs)) ; end:
    A162742 := proc(n) local a,p ; a := 1 ; for p in ifactors(n)[2] do a := a* A030101(op(1,p))^op(2,p) ; od: a; end:
  • Mathematica
    f[p_, e_] := IntegerReverse[p, 2]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 24 2023 *)
  • Python
    from math import prod
    from sympy import factorint
    def A162742(n): return prod(int(bin(f)[2:][::-1], 2)**e for f, e in factorint(n).items())
    print([A162742(n) for n in range(1, 81)]) # Michael S. Branicky, Oct 07 2024

Formula

A161955(n) = A030101(a(n)).

Extensions

Cleaned up the definition and corrected the second example - R. J. Mathar, Aug 03 2009
Showing 1-10 of 12 results. Next