OFFSET
1,1
COMMENTS
A "story prime" is a prime on top of a descending triangle (such as the ones below) where every "story" is prime:
.
6 0 1 1 0 6 3 9 6 2 9
6 1 1 6 3 3 4 7
5 5 3 1 3
2 2
.
Each digit "d" must be the absolute difference of the two digits above "d". No leading zeros are accepted at any stage. The biggest such prime is 528888881, with 9 stories. There are only 128 such primes.
LINKS
Jean-Marc Falcoz, Table of n, a(n) for n = 1..128
EXAMPLE
We see that the first 3 of the second row (from top) is the absolute difference between 5 and 2; the next digit is 6, the absolute difference between 2 and 8; etc.
5 2 8 8 8 8 8 8 1
3 6 0 0 0 0 0 7
3 6 0 0 0 0 7
3 6 0 0 0 7
3 6 0 0 7
3 6 0 7
3 6 7
3 1
2
MATHEMATICA
Select[Prime@ Range@ 720, Function[k, AllTrue[Most@ NestWhileList[Abs@ Differences@ # &, IntegerDigits@ k, # != {} &], And[First@ # != 0 &@ #, PrimeQ@ FromDigits@ #] &]]] (* Michael De Vlieger, Mar 16 2016, Version 10 *)
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Mar 16 2016
STATUS
approved