cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A347402 Lexicographically earliest sequence of distinct terms > 0 such that the product n * a(n) forms a palindrome in base 10.

Original entry on oeis.org

1, 2, 3, 11, 101, 37, 23, 29, 19, 0, 4, 21, 38, 18, 35, 17, 16, 14, 9, 0, 12, 22, 7, 88, 209, 26, 703, 31, 8, 0, 28, 66, 47, 121, 15, 77, 6, 13, 154, 0, 187, 143, 277, 48, 1129, 99, 33, 44, 239, 0, 291, 406, 132, 518, 91, 377, 303, 364, 219, 0, 442, 386, 287, 333, 777
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Aug 30 2021

Keywords

Comments

When n ends with a zero, we have a(n) = 0 in the sequence.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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