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.

A248754 Palindromes p=A002113(n) whose index n is also a palindrome and in addition a substring of p (strings in base 10).

This page as a plain text file.
%I A248754 #18 Jul 24 2024 18:11:02
%S A248754 11,1111,12221,23332,34443,45554,56665,67776,78887,89998,111111,
%T A248754 1222221,2333332,3444443,4555554,5666665,6777776,7888887,8999998,
%U A248754 9101019,11111111,102020201,112121211,122222221,132323231,142424241,152525251,162626261,172727271,182828281
%N A248754 Palindromes p=A002113(n) whose index n is also a palindrome and in addition a substring of p (strings in base 10).
%C A248754 This is a proper subsequence of A248753 (where the index does not need to be palindromic).
%e A248754 11 is a term because the eleventh palindrome is 11.
%e A248754 1111 is a member because it is the 111th palindrome.
%e A248754 12221 is in the sequence because the 222nd palindrome is 12221.
%t A248754 (* first load 'nthPalindrome' from A002113 and then *) nPal[n_] := nthPalindrome[n - 1];  fQ[n_] := StringPosition[ ToString[ nPal[ nPal[ k]]], ToString[ nPal[ n]]] != {}; k = 2; lst = {}; While[k < 501, If[ fQ[k], AppendTo[lst, nPal[ nPal[ k]] ]]; k++]; lst
%o A248754 (Python)
%o A248754 from itertools import count, islice
%o A248754 def A248754_gen(): # generator of terms
%o A248754     def f(n):
%o A248754         y = 10*(x:=10**(len(str(n>>1))-1))
%o A248754         return (c:=n-x)*x+int(str(c)[-2::-1] or 0) if n<x+y else (c:=n-y)*y+int(str(c)[::-1] or 0)
%o A248754     for n in count(2):
%o A248754         if str(m:=f(n)) in str(k:=f(m)):
%o A248754             yield k
%o A248754 A248754_list = list(islice(A248754_gen(),30)) # _Chai Wah Wu_, Jul 24 2024
%Y A248754 Cf. A002113, A248753.
%K A248754 nonn,base,easy
%O A248754 1,1
%A A248754 _Robert G. Wilson v_, Oct 13 2014