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

A050784 Palindromic primes containing no pair of consecutive equal digits.

Original entry on oeis.org

2, 3, 5, 7, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 10301, 10501, 10601, 12421, 12721, 12821, 13831, 13931, 14341, 14741, 15451, 16061, 16361, 16561, 17471, 17971, 18181, 18481, 19391, 19891, 30103, 30203
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Crossrefs

Programs

  • Maple
    nextL:= proc(L) local V,j,n,k;
      n:= LinearAlgebra:-Dimension(L);
      V:= L;
      for j from n to 1 by -1 do
        V[j]:= V[j]+1;
        if j > 1 then if V[j] = V[j-1] then V[j]:= V[j]+1 fi
        elif member(V[j],[2,8]) then V[j]:= V[j]+1
        elif member(V[j],[4,5,6]) then V[j]:= 7
        fi;
        if V[j] <= 9 then
          for k from j+1 to n do if (k-j)::odd then V[k]:= 0 else V[k]:= 1 fi od;
          return V
        fi;
      od;
      Vector(n+1, i -> i mod 2)
    end proc:
    Pali:= proc(L)
      local i,n;
      n:= LinearAlgebra:-Dimension(L);
      add(L[i]*10^(2*n-i-1),i=1..n)+add(L[i]*10^(i-1),i=1..n-1)
    end proc:
    V:= <5>: Res:= 2,3,5: count:= 3:
    while count < 100 do
      V:= nextL(V);
      x:= Pali(V);
      if isprime(x) then count:= count+1; Res:= Res, x fi;
    od:
    Res; # Robert Israel, Feb 07 2019
  • Mathematica
    Select[Prime[Range[3280]],Reverse[x=IntegerDigits[#]]==x&&FreeQ[Differences[x],0]&] (* Jayanta Basu, Jun 01 2013 *)

A088882 Nontrivial palindromes in base 10 (i.e., palindromes that are not RepDigits such as 3, 111, 22222, or 888888888).

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

Chuck Seggelin, Oct 21 2003

Keywords

Comments

The early portion of this sequence appears to be very similar to the early portions of two other sequences. Note that a(n) = A046075(n) for n = 1..81. A046075 deals with nontrivial undulants of 3 digits or more which by definition excludes RepDigits, but which includes non-palindromic terms when 4-digit numbers are reached. For example a(82) = 1001 but A046075(82) = 1010. Note also that a(n) = A050783(n+10) for n = 1..81. A050783 deals with palindromes that contain no consecutive pairs of equal digits, so although A050783 excludes RepDigits, it includes the single-digit palindromes and excludes a large number of the palindromes in this sequence (such as, for example, all the 4-digit nontrivial palindromes and larger nontrivial palindromes such as 22022 or 61116). A050783(92) = 10101. Note that in the first 65534 values of n there are 754 palindromes, 712 nontrivial palindromes and 42 RepDigits.

Examples

			a(4) = 141 because 141 is the fourth term of the sequence of base-10 palindromes (A002113) that does not appear in the sequence of RepDigits (A010785).
		

Crossrefs

Cf. A002113 (base-10 palindromes), A010785 (repdigits), A046075 (nontrivial undulants), A050783 (palindromes with no pair of consecutive equal digits).

Programs

  • Python
    from itertools import count, islice, product
    def agen(): # generator of terms
        digits = "0123456789"
        for d in count(3):
            for p in product(digits, repeat=d//2):
                if d > 1 and p[0] == "0": continue
                left = "".join(p); right = left[::-1]
                for mid in [[""], digits][d%2]:
                    t = left + mid + right
                    if len(set(t)) != 1: yield int(t)
    print(list(islice(agen(), 52))) # Michael S. Branicky, May 17 2022

A050785 Palindromes containing at least one pair of consecutive equal digits.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1001, 1111, 1221, 1331, 1441, 1551, 1661, 1771, 1881, 1991, 2002, 2112, 2222, 2332, 2442, 2552, 2662, 2772, 2882, 2992, 3003, 3113, 3223, 3333, 3443, 3553, 3663, 3773, 3883, 3993, 4004, 4114, 4224, 4334, 4444
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[3900],Reverse[x=IntegerDigits[#]]==x&&MemberQ[Differences[x],0]&] (* Jayanta Basu, Jun 01 2013 *)

Extensions

a(48)-a(53) from J.W.L. (Jan) Eerland, Jan 20 2025
Showing 1-3 of 3 results.