|
|
A344541
|
|
Lexicographically earliest sequence S of distinct nonnegative terms such that the sum of the last k digits of S is prime, k being the rightmost digit of a(n) and k > 1.
|
|
3
|
|
|
0, 2, 3, 12, 5, 6, 4, 8, 14, 15, 9, 13, 32, 23, 16, 24, 25, 18, 7, 17, 19, 28, 34, 35, 26, 27, 33, 37, 39, 36, 43, 52, 29, 44, 38, 46, 48, 47, 55, 53, 54, 49, 57, 58, 45, 64, 59, 65, 66, 74, 63, 56, 67, 68, 77, 73, 75, 69, 86, 83, 79, 89, 78, 85, 76, 92, 84, 98, 97, 88, 94, 99, 102, 95, 93, 87, 108, 96
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
No term ends with 1.
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|