|
|
A185893
|
|
Terms in A048398 ending with 1.
|
|
1
|
|
|
101, 12101, 32321, 210101, 432121, 1012321, 1212121, 3210101, 3210121, 3212101, 3232321, 3432101, 5432321, 5434321, 21212101, 21232121, 23210101, 23232101, 43432321, 45434321, 101012321, 101210101, 101232121, 121232101, 123210121, 123232121, 321012121
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Among first 114956 terms, number of n-digit terms are: 0, 0, 1, 0, 2, 2, 9, 6, 22, 23, 32, 57, 166, 246, 382, 572, 1770, 2936, 3956, 6183, 18132, 30818, 49641.
|
|
LINKS
|
|
|
MATHEMATICA
|
Select[Prime[Range[100000]], IntegerDigits[#][[-1]] == 1 && Union[Abs[Differences[IntegerDigits[#]]]] == {1} &]
|
|
PROG
|
(Python 3.2 or higher)
from itertools import product, accumulate
from sympy import isprime
for l in range(1, 19):
dlist = [1]*l
for elist in product([-1, 1], repeat=l):
flist = [str(d+e) for d, e in zip(dlist, accumulate(elist)) if 0 <= d+e < 10]
if len(flist) == l and flist[-1] != '0':
n = 10*int(''.join(flist[::-1])) + 1
if isprime(n):
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|