OFFSET
1,2
COMMENTS
When n ends with a zero, we have a(n) = 0 in the sequence.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 7 we have a(7) = 23 and 7 * 23 = 161 is a palindrome in base 10; indeed, at n=7, multiples 7 * 1 = 7 and 7 * 11 = 77 are palindromes but 1 and 11 have already appeared in the sequence. The next palindrome multiple is 7 * 23 = 161 and 23 has not yet appeared so a(7) = 23;
for n = 8 we have a(8) = 29 and 8 * 29 = 232 is a palindrome in base 10;
for n = 9 we have a(9) = 19 and 9 * 19 = 171 is a palindrome in base 10;
for n = 10 we have a(10) = 0 and 10 * 0 = 0 is a palindrome in base 10;
for n = 11 we have a(11) = 4 and 11 * 4 = 44 is a palindrome in base 10; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=If[Mod[n, 10]==0, 0, (k=1; While[!PalindromeQ[n*k]||MemberQ[Array[a, n-1], k], k++]; k)]; Array[a, 65] (* Giorgos Kalogeropoulos, May 05 2022 *)
PROG
(Python)
def ispal(n): s = str(n); return s == s[::-1]
def aupton(terms):
alst, seen = [1], {1}
for n in range(2, terms+1):
if n%10 == 0: alst.append(0); continue
an = 1
while an in seen or not ispal(n * an): an += 1
alst.append(an); seen.add(an)
return alst
print(aupton(100)) # Michael S. Branicky, Aug 30 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Aug 30 2021
STATUS
approved