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.

A108537 Concatenation of palindrome k and its 10's complement is prime.

This page as a plain text file.
%I A108537 #9 Jan 22 2019 17:30:46
%S A108537 1,3,7,77,99,151,161,333,707,727,737,757,949,969,989,1441,1551,1771,
%T A108537 1881,3003,7227,7667,7997,9009,9339,9999,10001,10101,10701,11111,
%U A108537 11611,11711,12221,12921,13231,14341,14841,14941,15851,16661,16961,17071
%N A108537 Concatenation of palindrome k and its 10's complement is prime.
%C A108537 Contains 10^k-1 for k in A056696, and (10^k-1)/9 for k in A108966. - _Robert Israel_, Jan 22 2019
%H A108537 Robert Israel, <a href="/A108537/b108537.txt">Table of n, a(n) for n = 1..10000</a>
%e A108537 a(7)=161 because 1000-161 = 839 and 161839 is prime.
%p A108537 N:= 5: # for terms of <= N digits
%p A108537 digrev:= proc(n) local L,i;
%p A108537    L:= convert(n,base,10);
%p A108537    add(L[-i]*10^(i-1),i=1..nops(L))
%p A108537 end proc:
%p A108537 Res:= 1,3,7,9:
%p A108537 for d from 2 to N do
%p A108537   if d::even then
%p A108537     m:= d/2;
%p A108537     Res:= Res, seq(seq((i*10^(m-1)+j)*10^m + digrev(i*10^(m-1)+j), j=0..10^(m-1)-1),i=[1,3,7,9]);
%p A108537   else
%p A108537     m:= (d-1)/2;
%p A108537     Res:= Res, seq(seq(seq((i*10^(m-1)+j)*10^(m+1)+y*10^m+digrev(i*10^(m-1)+j), y=0..9), j=0..10^(m-1)-1),i=[1,3,7,9]);
%p A108537   fi
%p A108537 od:
%p A108537 filter:= proc(t) local r;
%p A108537   r:= 10^(ilog10(t)+1)-t;
%p A108537   isprime(t*10^(ilog10(r)+1)+r)
%p A108537 end proc:
%p A108537 select(filter, [Res]); # _Robert Israel_, Jan 22 2019
%Y A108537 Cf. A056696, A108966.
%K A108537 base,easy,nonn
%O A108537 1,2
%A A108537 _Jason Earls_, Jul 25 2005