login
A351841
Lexicographically earliest infinite sequence of distinct positive integers such that a(1) = 1 and a(n) + a(n+1) is divisible by the last digit of a(n+1). No term ending in zero is allowed in the sequence.
1
1, 11, 13, 21, 3, 31, 23, 41, 43, 27, 9, 33, 37, 47, 51, 39, 17, 19, 53, 61, 29, 71, 73, 67, 59, 49, 7, 77, 81, 63, 91, 83, 57, 69, 93, 101, 79, 111, 121, 113, 97, 119, 103, 107, 109, 87, 123, 129, 131, 133, 141, 151, 143, 137, 157, 149, 117, 99, 153, 127, 89, 161, 147, 159, 171, 181, 173, 163
OFFSET
1,2
COMMENTS
Only terms ending in 1, 3, 7 or 9 are in the sequence.
Proof. If a(n-1) is odd, then a(n) cannot be even; otherwise, their sum would be odd and hence not divisible by a(n)'s last, even digit. For sake of contradiction, let a(n) be the first term in the sequence that ends in 5; then a(n-1) + a(n) ends in 0 and a(n-1) ends in 5 (a contradiction to a(n)'s being the first such term) or a(n-1) + a(n) ends in 5, which means a(n-1) ends in 0 (not allowed). - Michael S. Branicky, Feb 21 2022
LINKS
EXAMPLE
a(1) + a(2) = 1 + 11 = 12 which is divisible by 1 (the last digit of 11);
a(2) + a(3) = 11 + 13 = 24 which is divisible by 3 (the last digit of 13);
a(3) + a(4) = 13 + 21 = 34 which is divisible by 1 (the last digit of 21);
a(4) + a(5) = 21 + 3 = 24 which is divisible by 3 (the last digit of 3);
a(5) + a(6) = 3 + 31 = 34 which is divisible by 1 (the last digit of 31);
a(6) + a(7) = 31 + 23 = 54 which is divisible by 3 (the last digit of 23); etc.
MATHEMATICA
nn = 67; f[n_] := (5 n + Mod[3 n + 2, 4] - 4)/2; c[_] = 0; a[1] = c[1] = u = 1; Do[While[c[Set[v, f[u]]] != 0, u++]; j = v; While[Nand[c[#2] == 0, Mod[#1 + #2, Mod[#2, 10]] == 0] & @@ {a[n - 1], Set[k, f[j]]}, j++]; Set[{a[n], c[k]}, {k, n}], {n, 2, nn}]; Array[a[#] &, nn] (* Michael De Vlieger, Feb 21 2022 *)
PROG
(Python)
def aupton(terms):
alst, aset, minunused = [1], {1}, 2
while len(alst) < terms:
an = minunused
while an in aset or (an%10 == 0 or (alst[-1]+an)%(an%10)): an += 1
alst.append(an); aset.add(an)
while minunused in aset: minunused += 1
return alst
print(aupton(78)) # Michael S. Branicky, Feb 21 2022
CROSSREFS
Cf. A351840.
Sequence in context: A089774 A346287 A330975 * A257864 A248599 A366379
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 21 2022
STATUS
approved