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.

A081939 a(1) = 2; a(n+1) is the smallest palindrome > a(n) that has a common factor with a(n).

This page as a plain text file.
%I A081939 #14 Jul 04 2018 20:23:18
%S A081939 2,4,6,8,22,33,44,55,66,77,88,99,111,141,171,222,232,242,252,262,272,
%T A081939 282,292,404,414,424,434,444,454,464,474,484,494,585,595,616,626,636,
%U A081939 646,656,666,676,686,696,717,747,777,828,838,848,858,868,878,888,898
%N A081939 a(1) = 2; a(n+1) is the smallest palindrome > a(n) that has a common factor with a(n).
%C A081939 Palindromes with an even number of digits are divisible by 11, so when a(n)=A002113(k) and A055642(a(n)) and A055642(A002113(k+1)) are even, a(n+1)=A002113(k+1). - _Robert Israel_, Jul 04 2018
%H A081939 Robert Israel, <a href="/A081939/b081939.txt">Table of n, a(n) for n = 1..10000</a>
%H A081939 <a href="/index/Pac#palindromes">Index entries for sequences related to palindromes</a>
%p A081939 dmax:= 5: # to get all terms with at most dmax digits
%p A081939 revdigs:= proc(n)
%p A081939   local L, Ln, i;
%p A081939   L:= convert(n, base, 10);
%p A081939   Ln:= nops(L);
%p A081939   add(L[i]*10^(Ln-i), i=1..Ln);
%p A081939 end proc:
%p A081939 P:= $0..9:
%p A081939 for d from 2 to dmax do
%p A081939   if d::even then
%p A081939     P:= P, seq(10^(d/2)*x + revdigs(x), x=10^(d/2-1)..10^(d/2)-1)
%p A081939   else
%p A081939     m:= (d-1)/2;
%p A081939     P:= P, seq(seq(10^(m+1)*x + 10^m*j+revdigs(x), j=0..9),x=10^(m-1)..10^m-1);
%p A081939   fi
%p A081939 od:
%p A081939 P:= [P]:
%p A081939 r:= P[3]: Res:= r: count:= 1:
%p A081939 for i from 4 to nops(P) do
%p A081939   if igcd(P[i],r) > 1 then
%p A081939     count:= count+1; r:= P[i]; Res:= Res, r;
%p A081939   fi
%p A081939 od:
%p A081939 Res; # _Robert Israel_, Jul 04 2018
%o A081939 (PARI) ispal(n) = my(d=digits(n)); d == Vecrev(d);
%o A081939 lista(nn) = {print1(last = 2, ", "); for (n=3, nn, if (ispal(n) && (gcd(n, last) != 1), print1(n, ", "); last = n;););} \\ _Michel Marcus_, Aug 12 2015
%Y A081939 Cf. A002113, A055642, A083136, A081938.
%K A081939 base,nonn
%O A081939 1,1
%A A081939 _Amarnath Murthy_, Apr 02 2003
%E A081939 More terms from _David Wasserman_, Jun 29 2004