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.

A357195 a(n) is the smallest palindrome of the form k*(2*n+k-1)/2 where k is a positive integer.

This page as a plain text file.
%I A357195 #15 Oct 29 2022 12:00:59
%S A357195 1,2,3,4,5,6,7,8,9,33,11,969,222,99,66,33,242,282,424,161,66,22,212,
%T A357195 252,646,171,55,252,414,555,525,99,33,474,1001,111,5005,77,484,1111,
%U A357195 1881,414,808,44,606,141,404,303,99,101,555,444,333,222,55,171,484
%N A357195 a(n) is the smallest palindrome of the form k*(2*n+k-1)/2 where k is a positive integer.
%o A357195 (Python)
%o A357195 pal10 = lambda n: str(n) == str(n)[::-1]
%o A357195 def seq(n):
%o A357195     k = 1
%o A357195     while not pal10(k*(2*n+k-1)//2):k+=1
%o A357195     return k*(2*n+k-1)//2
%o A357195 print([seq(n) for n in range(1, 100)])
%o A357195 (Python)
%o A357195 from itertools import count
%o A357195 def A357195(n): return next(filter(lambda n:(s := str(n))[:(t:=len(s)+1>>1)]==s[:-t-1:-1],(k*((n<<1)+k-1)>>1 for k in count(1)))) # _Chai Wah Wu_, Oct 29 2022
%o A357195 (PARI) ispal(p) = my(d=digits(p)); d==Vecrev(d);
%o A357195 a(n) = my(k=1); while(!ispal(x=k*(2*n+k-1)/2), k++); x; \\ _Michel Marcus_, Sep 17 2022
%Y A357195 Cf. A020485, A002113, A262038.
%K A357195 base,nonn
%O A357195 1,2
%A A357195 _Gleb Ivanov_, Sep 17 2022