OFFSET
1,1
COMMENTS
In the definition, "position" refers to the position of the digit in the decimal expansion, starting counting at 1 for the least significant digit.
In the Example section, the notation a&b denotes the concatenation of two numbers, a and b.
a(n) = n for 2, 3, 5, 7, 11, 13, 17, 19, 101, 103, 107, 109, 113, ...
LINKS
Abhiram R Devesh, Table of n, a(n) for n = 1..1000
EXAMPLE
p = 2 -> (2^1) -> 2 (prime).
p = 23 -> (2^2)&(3^1) -> 43 (prime).
p = 337 -> (3^3)&(3^2)&(7^1) -> 2797 (prime).
MATHEMATICA
f[n_] := Block[{d = Reverse@ IntegerDigits@ n, k}, FromDigits[Reap@ For[k = 1, k <= Length@ d, k++, Sow[d[[k]]^k]] // Flatten // Rest // Reverse // IntegerDigits // Flatten]]; Select[Prime@ Range@ 125, PrimeQ[f@ #] &] (* Michael De Vlieger, Apr 02 2015 *)
PROG
(Python)
import sympy
def powdig(m):
....l=len(str(m))
....return(int(''.join([str(int(list(i)[1])**(l-list(i)[0])) for i in enumerate(list(str(m)))])))
n=2
while n>0:
....t=powdig(n)
....if sympy.isprime(t)==True:
........print(n)
....n=sympy.nextprime(n)
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Abhiram R Devesh, Feb 14 2015
STATUS
approved