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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

2, 4, 6, 8, 22, 33, 44, 55, 66, 77, 88, 99, 111, 141, 171, 222, 232, 242, 252, 262, 272, 282, 292, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 585, 595, 616, 626, 636, 646, 656, 666, 676, 686, 696, 717, 747, 777, 828, 838, 848, 858, 868, 878, 888, 898
Offset: 1

Views

Author

Amarnath Murthy, Apr 02 2003

Keywords

Comments

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

Crossrefs

Programs

  • Maple
    dmax:= 5: # to get all terms with at most dmax digits
    revdigs:= proc(n)
      local L, Ln, i;
      L:= convert(n, base, 10);
      Ln:= nops(L);
      add(L[i]*10^(Ln-i), i=1..Ln);
    end proc:
    P:= $0..9:
    for d from 2 to dmax do
      if d::even then
        P:= P, seq(10^(d/2)*x + revdigs(x), x=10^(d/2-1)..10^(d/2)-1)
      else
        m:= (d-1)/2;
        P:= P, seq(seq(10^(m+1)*x + 10^m*j+revdigs(x), j=0..9),x=10^(m-1)..10^m-1);
      fi
    od:
    P:= [P]:
    r:= P[3]: Res:= r: count:= 1:
    for i from 4 to nops(P) do
      if igcd(P[i],r) > 1 then
        count:= count+1; r:= P[i]; Res:= Res, r;
      fi
    od:
    Res; # Robert Israel, Jul 04 2018
  • PARI
    ispal(n) = my(d=digits(n)); d == Vecrev(d);
    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

Extensions

More terms from David Wasserman, Jun 29 2004
Showing 1-1 of 1 results.