OFFSET
1,2
COMMENTS
The first three primes in this sequence occur for n = 2 (a(2) = 5), n = 5 (a(5) = 3929), and n = 82 (a(82) = 1.1247...*10^140). - Kurt Foster, Oct 24 2015 [Comment added by N. J. A. Sloane, Oct 25 2015]
According to a comment made by Jeff Peltier following the "Most Wanted Prime" video, n = 2546 also gives a prime. See A360503. - N. J. A. Sloane, Feb 17 2023
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
Brady Haran and N. J. A. Sloane, Most Wanted Prime, Numberphile video, December 2021.
EXAMPLE
a(6): (1)(2)(10)(11)(12)(20) = 1210111220_3 = 35367.
MATHEMATICA
If[STARTPOINT==1, n={}, n=Flatten[IntegerDigits[Range[STARTPOINT-1], 3]]]; Table[AppendTo[n, IntegerDigits[w, 3]]; n=Flatten[n]; FromDigits[n, 3], {w, STARTPOINT, ENDPOINT}] (* Dylan Hamilton, Aug 09-04 2010 *)
f[n_]:= FromDigits[Flatten@IntegerDigits[Range@n, 3], 3]; Array[f, 20] (* Vincenzo Librandi, Dec 30 2012 *)
PROG
(Magma) [n eq 1 select 1 else Self(n-1)*3^(1+Ilog(3, n))+n: n in [1..20]]; // Vincenzo Librandi, Dec 30 2012
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Patrick De Geest, May 15 1999
STATUS
approved