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-2 of 2 results.

A325323 Palindromes in base 10 that are not Brazilian.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 787, 797, 919, 929, 10201, 10301, 10501, 10601, 11311, 11411, 12421, 12721, 12821, 13331, 13831, 13931, 14341, 14741, 15451, 15551, 16061, 16361, 16561, 16661, 17471, 17971, 18181, 18481, 19391, 19891, 19991
Offset: 1

Views

Author

Bernard Schott, Apr 20 2019

Keywords

Comments

The terms >= 11 of this sequence are either prime palindromes which are not Brazilian, or square of primes (except 121).

Crossrefs

Intersection of A002113 and A220570.
Complement of A325322 with respect to A002113.
Cf. A088882 (Palindromes not repdigits).

Programs

  • Mathematica
    brazQ[n_] := Module[{b = 2, found = False}, While[b < n - 1 && Length @ Union[IntegerDigits[n, b]] > 1, b++]; b < n - 1]; Select[Range[20000], PalindromeQ[#] && !brazQ[#] &] (* Amiram Eldar, Apr 14 2021 *)
  • PARI
    isb(n) = for(b=2, n-2, my(d=digits(n, b)); if(vecmin(d)==vecmax(d), return(1))); \\ A125134
    isp(n) = my(d=digits(n)); d == Vecrev(d); \\ A002113
    isok(n) = !isb(n) && isp(n); \\ Michel Marcus, Apr 22 2019

A261453 Near-repdigit palindromes with an odd number of digits and all digits except the middle digit equal.

Original entry on oeis.org

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
Offset: 1

Views

Author

Felix Fröhlich, Aug 25 2015

Keywords

Crossrefs

Subsequence of A088882.

Programs

  • Maple
    isA261453 := proc(n)
        local ndgs,dgs,d ;
        if isA002113(n) then
            ndgs := A055642(n) ;
            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;
    end do: # R. J. Mathar, Sep 30 2015
  • 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 *)
    Select[Flatten[Table[FromDigits[Join[PadRight[{},n,rd],{k},PadRight[{},n,rd]]],{n,3},{rd,9},{k,0,9}]],Count[DigitCount[#],0]==8&] (* Harvey P. Dale, Nov 30 2024 *)
  • 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_a001633(n) = #Str(n)%2 \\ after Charles R Greathouse IV in A001633
    is(n) = is_a002113(n) && is_a210666(n) && is_a001633(n) \\ Felix Fröhlich, May 25 2022
  • 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)
    print(list(islice(agen(), 52))) # Michael S. Branicky, May 17 2022
    

Formula

a(n) = A002113(A210666(A001633(n))).
Showing 1-2 of 2 results.