login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
Cf. A344539 and A344540.
Sequence in context: A030611 A252177 A214011 * A081369 A147967 A120487
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, May 22 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 08:22 EDT 2024. Contains 371236 sequences. (Running on oeis4.)