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.

A085325 a(n) is the least number m such that the minimal exponent for which reverse(m^n) = prime holds is n. Thus reverse(m^k) is composite for k = 1, .., n-1.

Original entry on oeis.org

2, 4, 52, 61, 43, 49, 29, 8, 223, 53, 83, 59, 25, 568, 47, 221, 229, 1286, 427, 629, 637, 46, 109, 652, 458, 925, 1438, 86, 674, 535, 574, 314, 623, 173, 236, 676, 689, 205, 67, 419, 161, 976, 634, 818, 2104, 304, 26, 2392, 5012, 767, 238, 1769, 185, 3148, 3554
Offset: 1

Views

Author

Labos Elemer, Jul 02 2003

Keywords

Examples

			For n = 10, a(10) = 53: This means that reverse(53^10) = 940315563074788471 is prime, but reverse(53^k) is composite for k=1, ..., 9. Also, reverse(m^10) for m < a(10) = 53 is not prime. However m > 53 is possible like, e.g., reverse(103^10) is prime. 10 as the least exponent belongs to several bases of which a(10) = 53 is the smallest one.
		

Crossrefs

Cf. A004086 (reverse), A085324.

Programs

  • Mathematica
    q[m_, n_] := AllTrue[Range[n - 1], CompositeQ[IntegerReverse[m^#]] &] && PrimeQ[IntegerReverse[m^n]]; a[n_] := Module[{m = 2}, While[! q[m, n], m++]; m]; Array[a, 30] (* Amiram Eldar, Feb 11 2025 *)

Extensions

More terms from Amiram Eldar, Feb 11 2025

A058998 Least exponent k for which n^k reversed (leading zeros are not allowed) is a prime, or 0 if impossible.

Original entry on oeis.org

0, 1, 1, 2, 1, 0, 1, 8, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 2, 0, 0, 0, 8, 0, 13, 47, 0, 2, 7, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 2, 0, 5, 0, 0, 22, 15, 0, 6, 0, 0, 3, 10, 0, 0, 143, 0, 88, 12, 0, 4, 2, 0, 4, 8, 0, 39, 83, 0, 0, 1, 0, 1, 1, 0
Offset: 1

Views

Author

Robert G. Wilson v, Jan 17 2001

Keywords

Comments

There are two different versions of this sequence: A085324 and this sequence which agrees with A085324 on the first 19 terms, but differs at a(20).

Examples

			a(4) is 2, because 4^2 is 16, and 16 reversed is 61 which is prime.
		

Crossrefs

Cf. A085324.

Programs

  • Maple
    Rev:= proc(n) local L;
    L:= convert(n,base,10);
    add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    f:= proc(n) local k;
      if igcd(n,33) <> 1 or (n/10)::integer then return 0 fi;
      for k from 1 do if isprime(Rev(n^k)) then return k fi od:
    end proc:
    f(1):= 0: f(3):= 1: f(11):= 1:
    map(f, [$1..168]); # Robert Israel, Apr 08 2018
  • Mathematica
    Do[ If[ Mod[ n, 3 ] != 0 && Mod[ n, 10 ] != 0 && Mod[ n, 11 ] != 0, k = 1; While[ !PrimeQ[ ToExpression[ StringReverse[ ToString[ n^k ] ] ] ], k++ ]; Print[ k ], Print[ 0 ] ], {n, 2, 75} ]

Formula

a(n*10^k) = 0 for all k > 0 since definition does not allow leading 0's.

A085326 a(n)=p is smallest prime such that rev(p)=n^j with some exponent, or 0 if no such prime exists [when e.g. n=1,n=3k or n=11k, k>1].

Original entry on oeis.org

0, 2, 3, 61, 5, 0, 7, 61277761, 0, 0, 11, 0, 31, 41, 0, 61, 71, 0, 163, 2, 0, 0, 18258901387, 0, 5265674839116110941, 6716872795737314976899264656807717363719079328404119318887571869813, 0
Offset: 1

Views

Author

Labos Elemer, Jul 03 2003

Keywords

Examples

			n=86: a(86)=6505868216024313214870917495263873755562243530151045641,
and rev[86]=86^28.
		

Crossrefs

Showing 1-3 of 3 results.