[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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