login
A072804
n-th prime prime(n) written in base (prime(n) (mod 4)).
4
10, 10, 11111, 21, 102, 1111111111111, 11111111111111111, 201, 212, 11111111111111111111111111111, 1011, 1111111111111111111111111111111111111, 11111111111111111111111111111111111111111, 1121, 1202, 11111111111111111111111111111111111111111111111111111, 2012
OFFSET
1,1
LINKS
EXAMPLE
4k+1 primes are written in base 1, while 4k+3 primes are in base 3.
MATHEMATICA
Table[FromDigits@ If[#2 == 1, ConstantArray[1, #1], IntegerDigits[#1, #2]] & @@ {#, Mod[#, 4]} &@ Prime@ w, {w, 17}] (* Michael De Vlieger, Sep 04 2019 *)
PROG
(PARI) a(n) = {my(p=prime(n)); if ((p % 4) != 1, fromdigits(digits(p, p % 4), 10), fromdigits(vector(p, k, 1), 10)); } \\ Michel Marcus, Sep 04 2019
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Labos Elemer, Jul 12 2002
STATUS
approved