login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A341090 Fully multiplicative: for any prime p, if the reversal of p in base 10, say q, is prime, then a(p) = q, otherwise a(p) = p. 2

%I #16 Feb 15 2022 21:12:56

%S 1,2,3,4,5,6,7,8,9,10,11,12,31,14,15,16,71,18,19,20,21,22,23,24,25,62,

%T 27,28,29,30,13,32,33,142,35,36,73,38,93,40,41,42,43,44,45,46,47,48,

%U 49,50,213,124,53,54,55,56,57,58,59,60,61,26,63,64,155,66

%N Fully multiplicative: for any prime p, if the reversal of p in base 10, say q, is prime, then a(p) = q, otherwise a(p) = p.

%C This sequence is a self-inverse permutation of the natural numbers.

%H Rémy Sigrist, <a href="/A341090/a341090.png">Scatterplot of (n, a(n)) for n, a(n) <= 1000000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%e For n = 377:

%e - 377 = 13 * 29,

%e - the reversal of 13, 31, is prime,

%e - the reversal of 29, 92, is not prime,

%e - so a(377) = 31 * 29 = 899.

%p R:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||n):

%p a:= proc(n) option remember; mul((q->

%p `if`(isprime(q), q, j[1]))(R(j[1]))^j[2], j=ifactors(n)[2])

%p end:

%p seq(a(n), n=1..66); # _Alois P. Heinz_, Feb 15 2022

%t f[p_, e_] := If[PrimeQ[(q = IntegerReverse[p])], q, p]^e; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Feb 15 2022 *)

%o (PARI) a(n) = { my (f=factor(n)); prod (k=1, #f~, my (p=f[k,1], e=f[k,2], q=fromdigits(Vecrev(digits(p)))); if (isprime(q), q, p)^e) }

%Y Cf. A004086, A071786, A235027.

%K nonn,base,mult

%O 1,2

%A _Rémy Sigrist_, Feb 13 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 27 20:20 EDT 2024. Contains 373753 sequences. (Running on oeis4.)