%I #17 Feb 26 2023 08:43:44
%S 1,2,7,77,141,151,161,242,252,262,777,7777,14041,14141,14241,15051,
%T 15151,15251,16061,16161,16261,24042,24142,24242,25052,25152,25252,
%U 26062,26162,26262,77777,777777,1404041,1405041,1406041,1414141,1415141
%N Palindromes k such that 3k + 1 is also a palindrome.
%C From _Robert Israel_, Feb 23 2023: (Start)
%C Includes A002281. It appears that the only terms with an even number of digits are in A002281. All other terms of more than 1 digit start with 14, 15, 16, 24, 25 or 26. It also appears that no terms contain the digits 3, 8 or 9, and the only ones that contain 7 are A002281. (End)
%H Robert Israel, <a href="/A083829/b083829.txt">Table of n, a(n) for n = 1..6576</a>
%p ispali:= proc(n) local L;
%p L:= convert(n,base,10);
%p L = ListTools:-Reverse(L)
%p end proc:
%p revdigs:= proc(n) local L,i;
%p L:= convert(n,base,10);
%p add(L[-i]*10^(i-1),i=1..nops(L))
%p end proc:
%p palis:= proc(d) local r;
%p if d::even then [seq](revdigs(r)+10^(d/2)*r,r=10^(d/2-1)..10^(d/2)-1)
%p else [seq](revdigs(floor(r/10))+10^((d-1)/2)*r, r=10^((d-1)/2)..10^((d+1)/2)-1)
%p fi
%p end proc:
%p [seq(op(select(t -> ispali(3*t+1), palis(d))),d=1..7)]; # _Robert Israel_, Feb 23 2023
%t Select[Range[15*10^5],AllTrue[{#,3#+1},PalindromeQ]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Feb 14 2018 *)
%Y Cf. A083830.
%K base,nonn
%O 1,2
%A _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 09 2003
%E Corrected and extended by _Ray Chandler_, May 21 2003
|