OFFSET
2,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..62 (a(63) needs digits > 9)
EXAMPLE
Eventually non-decimal digit symbols appear, as in case of 307=17d, in base 14 = 307 mod 293.
MAPLE
a:= proc(n) local b, p, l;
p:= ithprime(n); b:= irem(p, prevprime(p));
if b=1 then l:= 1$p
else l:= ""; while p>0 do l:= irem(p, b, 'p'), l od
fi; parse(cat(l))
end:
seq(a(n), n=2..62); # Alois P. Heinz, Sep 05 2019
MATHEMATICA
Table[BaseForm[Prime[w], Mod[Prime[w], Prime[w-1]]], {w, 2, 128}]
Join[{111}, FromDigits[IntegerDigits[#[[2]], Mod[#[[2]], #[[1]]]]]&/@ Partition[ Prime[Range[2, 50]], 2, 1]] (* Harvey P. Dale, Jul 03 2021 *)
PROG
(PARI) a(n) = {my(p=prime(n), q=prime(n-1)); if ((p % q) != 1, d=digits(p, p % q); if (#select(x->(x>9), d), 0, fromdigits(d, 10)), fromdigits(vector(p, k, 1), 10)); } \\ Michel Marcus, Sep 05 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Labos Elemer, Jul 12 2002
EXTENSIONS
Name corrected by Michel Marcus, Sep 05 2019
STATUS
approved
