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.

A352341 Numbers whose maximal Pell representation (A352339) is palindromic.

This page as a plain text file.
%I A352341 #9 Mar 14 2022 02:42:03
%S A352341 0,1,3,6,8,10,20,27,40,49,54,58,63,68,88,93,119,136,150,167,221,238,
%T A352341 288,300,310,322,334,338,360,372,382,394,406,508,530,542,696,737,771,
%U A352341 812,833,867,908,942,983,1242,1276,1317,1392,1681,1710,1734,1763,1792,1802
%N A352341 Numbers whose maximal Pell representation (A352339) is palindromic.
%C A352341 A000129(n) - 2 is a term for n > 1. The maximal Pell representations of these numbers are 0, 11, 121, 1221, 12221, ... (0 and A132583).
%C A352341 A048739 is a subsequence since these are the repunit numbers in the maximal Pell representation.
%C A352341 A065113 is a subsequence since the maximal Pell representation of A065113(n) is 2*n 2's.
%H A352341 Amiram Eldar, <a href="/A352341/b352341.txt">Table of n, a(n) for n = 1..10000</a>
%e A352341 The first 10 terms are:
%e A352341    n  a(n)  A352339(a(n))
%e A352341   --  ----  -------------
%e A352341    1    0               0
%e A352341    2    1               1
%e A352341    3    3              11
%e A352341    4    6              22
%e A352341    5    8             111
%e A352341    6   10             121
%e A352341    7   20            1111
%e A352341    8   27            1221
%e A352341    9   40            2222
%e A352341   10   49           11111
%t A352341 pell[1] = 1; pell[2] = 2; pell[n_] := pell[n] = 2*pell[n - 1] + pell[n - 2]; pellp[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[pell[k] <= m, k++]; k--; AppendTo[s, k]; m -= pell[k]; k = 1]; IntegerDigits[Total[3^(s - 1)], 3]]; lazy[n_] := Module[{v = pellp[n]}, nv = Length[v]; i = 1; While[i <= nv - 2, If[v[[i]] > 0 && v[[i + 1]] == 0 && v[[i + 2]] < 2, v[[i ;; i + 2]] += {-1, 2, 1}; If[i > 2, i -= 3]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 0, FromDigits[v[[i[[1, 1]] ;; -1]]]]]; Select[Range[0, 2000], PalindromeQ[lazy[#]] &]
%Y A352341 Cf. A000129, A048739, A065113, A132583, A352339.
%Y A352341 Similar sequences: A002113, A006995, A014190, A094202, A331191, A351712, A351717, A352087, A352105, A352319.
%K A352341 nonn,base
%O A352341 1,3
%A A352341 _Amiram Eldar_, Mar 12 2022