|
|
A362535
|
|
Smallest prime ending with all base-n digits in consecutive order.
|
|
1
|
|
|
5, 59, 283, 3319, 95177, 6611219, 17119607, 1168314911, 100123456789, 3426593164037, 142731293952659, 304978405943587, 333425956286418337, 9635899740880849409, 535037563666793483759, 42192484763476168476011, 39482554816041508293677, 39574499346711396207137369
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
COMMENTS
|
When written in base n, these are the smallest primes that end with the largest base-n metadrome (A023811).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = k*(n^n) + (-1 + n - n^2 + n^n)/((-1 + n)^2), where k > 0 is the least integer such that a(n) is prime.
|
|
EXAMPLE
|
a(2) = 5 because 5 = 101_2.
a(3) = 59 because 59 = 2012_3.
a(4) = 283 because 283 = 10123_4.
a(12) = 16*(12^12) + (-1 + 12 - 12^2 + 12^12)/((-1+12)^2) = 142731293952659 is the least prime (at k = 16).
|
|
MAPLE
|
f:= proc(n) local k, s, m;
s:= (-1 + n - n^2 + n^n)/((-1 + n)^2);
m:= n^n;
for k from 1 do if isprime(k*m+s) then return k*m+s fi od
end proc:
|
|
PROG
|
(Python)
from sympy import isprime
from itertools import count
def a(n):
c, d = n**n, (-1 + n - n**2 + n**n)//((-1 + n)**2)
return next(ak for ak in count(c+d, c) if isprime(ak))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|