OFFSET
1,2
COMMENTS
No term ends with 1.
EXAMPLE
a(1) = 0, k must be > 1;
a(2) = 2, k = 2, and the sum 0 + 2 (= 2) is prime;
a(3) = 3, k = 3, and the sum 0 + 2 + 3 (= 5) is prime;
a(4) = 12, k = 2, and the sum 1 + 2 (= 3) is prime;
a(5) = 5, k = 5, and the sum 2 + 3 + 1 + 2 + 5 (= 13) is prime;
a(6) = 6, k = 6, and the sum 2 + 3 + 1 + 2 + 5 + 6 (= 19) is prime; etc.
MATHEMATICA
a[1]=0; a[n_]:=a[n]=Block[{t=1}, While[(k=t~Mod~10; k>Length[s=Flatten[IntegerDigits/@Join[Array[a, n-1], {t}]]])||k<2||MemberQ[Array[a, n-1], t]||!PrimeQ@Total[s[[-k;; ]]], t++]; t]; Array[a, 78] (* Giorgos Kalogeropoulos, May 10 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, May 22 2021
STATUS
approved