|
|
A261453
|
|
Near-repdigit palindromes with an odd number of digits and all digits except the middle digit equal.
|
|
1
|
|
|
101, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 454, 464, 474, 484, 494, 505, 515, 525, 535, 545, 565, 575, 585, 595, 606, 616, 626, 636, 646, 656, 676
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
isA261453 := proc(n)
local ndgs, dgs, d ;
if isA002113(n) then
if type(ndgs, 'odd') and A043537(n) = 2 then
dgs := convert(n, base, 10) ;
for d from 2 to nops(dgs)/2 do
if op(d, dgs) <> op(d-1, dgs) then
return false;
end if;
end do:
true ;
else
false;
end if;
else
false;
end if;
end proc:
n := 1:
for i from 100 to 2000000 do
if isA261453(i) then
printf("%d %d\n", n, i) ;
n := n+1 ;
end if;
|
|
MATHEMATICA
|
id[n_]:=IntegerDigits[n]; len[n_]:=Length[id[n]];
del[n_]:=Delete[id[n], Ceiling[len[id[n]]/2]];
u[n_]:=Union[del[id[n]]];
Select[Range[10^5], StringMatchQ[ToString[#], a__~~b_~~a__]&&Length[u[#]]==1&&u[#]!= Union[id[#]]&] (* Ivan N. Ianakiev, Sep 06 2015 *)
|
|
PROG
|
(Python)
from itertools import count, islice
def agen(): # generator of terms
for d in count(1):
for out in "123456789":
for mid in "0123456789":
if mid != out:
yield int(out*d + mid + out*d)
(PARI) is_a002113(n) = my(d=digits(n)); d==Vecrev(d)
is_a210666(n) = my(d=digits(n)); #d>2 && (#setintersect(vecsort(d), vector(#d, x, vecmax(d)))==#d-1 || #setintersect(vecsort(d), vector(#d, x, vecmin(d)))==#d-1)
is(n) = is_a002113(n) && is_a210666(n) && is_a001633(n) \\ Felix Fröhlich, May 25 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|