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-10 of 21 results. Next

A065531 Number of palindromes in all base b representations for n, for 2<=b<=n.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 3, 3, 3, 1, 3, 4, 2, 2, 4, 2, 4, 3, 4, 2, 3, 3, 3, 3, 3, 2, 5, 2, 3, 2, 5, 2, 4, 2, 3, 4, 4, 1, 5, 2, 4, 4, 5, 1, 4, 4, 4, 4, 2, 2, 6, 2, 3, 5, 4, 5, 4, 3, 4, 2, 4, 2, 6, 3, 3, 3, 3, 2, 6, 1, 7, 3, 4, 2, 6, 5, 3, 2, 5, 2, 5, 4, 5, 4, 2, 2, 6, 2, 5, 4, 7, 2, 4, 1, 6, 6
Offset: 1

Views

Author

Naohiro Nomoto, Dec 02 2001

Keywords

Comments

a(1) = 1 by convention, which makes this sequence different from A135551.
Index of first occurrence of k in A037183. - Robert G. Wilson v, Oct 27 2014

Crossrefs

Essentially the same as A135551.

Programs

A135549 Number of bases b, 1 < b < n-1, in which n is a palindrome.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 2, 2, 2, 0, 2, 3, 1, 1, 3, 1, 3, 2, 3, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 1, 4, 1, 3, 1, 2, 3, 3, 0, 4, 1, 3, 3, 4, 0, 3, 3, 3, 3, 1, 1, 5, 1, 2, 4, 3, 4, 3, 2, 3, 1, 3, 1, 5, 2, 2, 2, 2, 1, 5, 0, 6, 2, 3, 1, 5, 4, 2, 1, 4, 1, 4, 3, 4, 3, 1, 1, 5, 1, 4, 3, 6, 1, 3, 0, 5
Offset: 0

Views

Author

John P. Linderman, Feb 26 2008, Feb 28 2008

Keywords

Comments

Every integer n is a palindrome when expressed in unary, or in base n-1 (where it will be 11). So here we assume 1 < b < n-1.
Records for a(n)>=1 are in A107129. - Dmitry Kamenetsky, Oct 22 2015

Crossrefs

Cf. A016038 (non-palindromic numbers in any base 1 < b < n-1)

Programs

  • Mathematica
    a = {0, 0, 0}; For[n = 4, n < 100, n++, c = 0; For[b = 2, b < n - 1, b++, If[IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]], c++ ]]; AppendTo[a, c]]; a (* Stefan Steinerberger, Feb 27 2008 *)
    Table[cnt=0; Do[d=IntegerDigits[n,b]; If[d==Reverse[d], cnt++ ], {b,2,n-2}]; cnt, {n,0,100}] (* T. D. Noe, Feb 28 2008 *)
    Table[Total[Boole[Table[PalindromeQ[IntegerDigits[n,b]],{b,2,n-2}]]],{n,0,120}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 14 2020 *)

Formula

a(n) = A065531(n)-1 = A126071(n)-2 for n>2. - T. D. Noe, Feb 28 2008

A050813 Numbers n not palindromic in any base b, 2 <= b <= 10.

Original entry on oeis.org

19, 39, 47, 53, 58, 69, 75, 76, 79, 84, 87, 90, 94, 95, 96, 102, 103, 106, 108, 110, 115, 116, 120, 122, 132, 133, 134, 137, 139, 140, 143, 144, 147, 149, 152, 155, 158, 159, 163, 167, 168, 169, 174, 175, 176, 177, 179, 180, 183, 184, 187, 188, 193, 196, 198
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Crossrefs

Cf. A214423, A214424, A214425, A214426 (palindromic in 1-4 bases).

Programs

  • Mathematica
    n = -1; t = {}; While[Length[t] < 100, n++; If[Count[Table[s = IntegerDigits[n, m]; s == Reverse[s], {m, 2, 10}], True] == 0, AppendTo[t, n]]]; t (* T. D. Noe, Jul 18 2012 *)

Formula

A050812(n) = 0.

A135551 Number of bases b, 1 < b < n, in which n is a palindrome.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 3, 3, 3, 1, 3, 4, 2, 2, 4, 2, 4, 3, 4, 2, 3, 3, 3, 3, 3, 2, 5, 2, 3, 2, 5, 2, 4, 2, 3, 4, 4, 1, 5, 2, 4, 4, 5, 1, 4, 4, 4, 4, 2, 2, 6, 2, 3, 5, 4, 5, 4, 3, 4, 2, 4, 2, 6, 3, 3, 3, 3, 2, 6, 1, 7, 3, 4, 2, 6, 5, 3, 2, 5, 2, 5, 4, 5, 4, 2, 2, 6, 2, 5, 4, 7, 2, 4, 1, 6
Offset: 0

Views

Author

John P. Linderman, Feb 26 2008, Feb 28 2008

Keywords

Comments

Every integer n is a palindrome when expressed in unary, or in base n-1 (where it will be 11).
First occurrence in A037183.
a(n) is always less than A001221(n) except for 2 and 6; a(n) is always less than A001222(n) except for even powers of twos and 6, 12, 81, 243, 625, 729, 2187, 19683, 59049, ..., . - Robert G. Wilson v, Jul 17 2016

Crossrefs

Essentially the same as A065531.

Programs

  • Mathematica
    palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 1}]]; Array[ Length@ palindromicBases@# &, 105, 0] (* Robert G. Wilson v, Oct 15 2014 *)
    palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]];
    f[n_] := Block[{s = Ceiling@ Sqrt@ n, b = 2, c = If[ IntegerQ@ Sqrt[4n + 1], -1, 0]}, While[b < s, If[ palQ[n, b], c++]; b++]; c + Count[ Mod[n, Range[s - 1]], 0]]; f[0] = 0; Array[f, 105, 0] (* much faster for large Ns *) (* Robert G. Wilson v, Oct 20 2014 *)

Formula

a(n) = A135549(n) + 1 for n>2; otherwise a(n) = A135549(n) = 0. - Michel Marcus, Oct 15 2014
a(n) = A126071(n) - 1. - Michel Marcus, Mar 07 2015

A047811 Numbers n >= 4 that are not palindromic in any base b, 2 <= b <= n/2.

Original entry on oeis.org

4, 6, 11, 19, 47, 53, 79, 103, 137, 139, 149, 163, 167, 179, 223, 263, 269, 283, 293, 311, 317, 347, 359, 367, 389, 439, 491, 563, 569, 593, 607, 659, 739, 827, 853, 877, 977, 983, 997, 1019, 1049, 1061, 1187, 1213, 1237, 1367, 1433, 1439, 1447, 1459
Offset: 1

Views

Author

Keywords

Comments

Sequence A016038 is identical up to four additional terms: 0, 1, 2, 3; see there for more information.
Note that no prime p is palindromic in base b for the range sqrt(p) < b < p-1. Hence to find non-palindromic primes, we need only examine bases up to floor(sqrt(p)), which greatly reduces the computational effort required. - T. D. Noe, Mar 01 2008
This sequence is mentioned in the paper by Richard Guy, in which he reports on unsolved problems. This problem came from Mario Borelli and Cecil B. Mast. The paper poses two questions about these numbers: (1) Can palindromic or nonpalindromic primes be otherwise characterized? and (2) What is the cardinality, or the density, of the set of palindromic primes? Of the set of nonpalindromic primes? - T. D. Noe, Apr 17 2011

Crossrefs

Programs

  • Mathematica
    Select[Range[4,1500],And@@(#!=Reverse[#]&/@Table[IntegerDigits[#,b],{b,2,#/2}])&] (* Harvey P. Dale, May 22 2013 *)
  • PARI
    is(n)=!for(b=2,n\2,Vecrev(d=digits(n,b))==d&&return)&&n>3 \\ M. F. Hasler, Sep 08 2015

Formula

a(n) = A016038(n+4) for all n. - M. F. Hasler, Sep 08 2015

Extensions

Extended (and corrected) by Patrick De Geest, Oct 15 1999
Minor edits by M. F. Hasler, Sep 08 2015

A050812 Number of times n is palindromic in bases b, 2 <= b <= 10.

Original entry on oeis.org

9, 9, 8, 8, 7, 7, 5, 5, 4, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 0, 2, 3, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 0, 3, 1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2, 2, 0, 1, 3, 1, 2, 0, 1, 1, 1, 1, 3, 1, 3, 1, 2, 1, 0, 1, 1, 1, 2, 1, 0, 0, 1, 2, 0, 3, 1, 2, 1, 0, 3
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Examples

			a(121) = 4 since 121_10, 171_8, 232_7 and 11111_3 are palindromes.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Table[IntegerDigits[n,b],{b,2,10}],?(#==Reverse[#]&)],{n,0,90}] (* _Harvey P. Dale, Aug 18 2012 *)
  • PARI
    a(n) = sum(b=2, 10, my(d=digits(n, b)); d == Vecrev(d)); \\ Michel Marcus, Sep 09 2021
  • Python
    from sympy.ntheory.digits import digits
    def ispal(n, b):
        digs = digits(n, b)[1:]
        return digs == digs[::-1]
    def a(n): return sum(ispal(n, b) for b in range(2, 11))
    print([a(n) for n in range(87)]) # Michael S. Branicky, Sep 09 2021
    

A016026 Smallest base relative to which n is palindromic.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 10, 5, 3, 6, 2, 3, 2, 5, 18, 3, 2, 10, 3, 5, 4, 3, 2, 3, 4, 9, 2, 7, 2, 4, 6, 5, 6, 4, 12, 3, 5, 4, 6, 10, 2, 4, 46, 7, 6, 7, 2, 3, 52, 8, 4, 3, 5, 28, 4, 9, 6, 5, 2, 7, 2, 10, 5, 3, 22, 9, 7, 5, 2, 6, 14, 18, 10, 5, 78, 3, 8, 3, 5, 11, 2, 6, 28, 5, 8, 14, 3, 6
Offset: 1

Views

Author

Keywords

Comments

From Hieronymus Fischer, Jan 05 2014: (Start)
The terms are well defined since each number m > 2 is palindromic in base m - 1.
A number n > 6 is prime, if a(n) = n - 1.
Numbers m of the form m = q * p with q < p - 1, are palindromic in base p - 1, and therefore a(m) <= p.
Numbers m of the form m := j*(p^k - 1)/(p - 1), 1 <= j < p are palindromic in base p, and therefore: a(m) <= p.(End)

Examples

			n = 4 = 11_3 is palindromic in base 3, but not palindromic in base 2, hence a(4) = 3. [Typo corrected by _Phil Ronan_, May 22 2014]
n = 14 = 22_6 is palindromic in base 6, but not palindromic in any other base < 6, hence a(14) = 6.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_, b_] := Reverse[x = IntegerDigits[n, b]] == x; Table[base = 2; While[!palQ[n, base], base++]; base, {n, 92}] (* Jayanta Basu, Jul 26 2013 *)
  • PARI
    ispal(n, b) = my(d=digits(n,b)); d == Vecrev(d);
    a(n) = my(b=2); while (! ispal(n, b), b++); b; \\ Michel Marcus, Sep 22 2017
    
  • Python
    from itertools import count
    from sympy.ntheory.factor_ import digits
    def A016026(n): return next(b for b in count(2) if (s := digits(n,b)[1:])[:(t:=len(s)+1>>1)]==s[:-t-1:-1]) # Chai Wah Wu, Jan 17 2024

Formula

From Hieronymus Fischer, Jan 05 2014: (Start)
a(A016038(n)) = A016038(n) - 1, for n > 3.
a(A006995(n)) = 2, for n > 1.
a(A002113(n)) <= 10 for n > 1. (End)
To put Fischer's comments in words: if n > 3 is a strictly non-palindromic number (A016038), then a(n) = n - 1. If n > 1 is a binary palindrome (A006995), then a(n) = 2. And if n > 1 is a decimal palindrome, then a(n) <= 10. - Alonso del Arte, Sep 15 2017

A139819 Complement of repdigit numbers A010785.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89
Offset: 1

Views

Author

N. J. A. Sloane, Jun 02 2008

Keywords

Comments

Identical to (base 10) non-palindromic numbers A029742 up to a(83) = 101 which is a term of this sequence but not in A029742. - M. F. Hasler, Sep 08 2015

Crossrefs

Cf. A066484 (subsequence).
Cf. A029742 (non-palindromic in base 10), A016038 (in any base), A050813 (in bases 2..10).

Programs

  • Haskell
    a139819 n = a139819_list !! (n-1)
    a139819_list = filter ((== 0) . a202022) [0..] -- Reinhard Zumkeller, Dec 09 2011
    
  • Maple
    isA139819 := proc(n)
        convert(n,base,10) ;
        convert(%,set) ;
        simplify(nops(%) >1 ) ;
    end proc: # R. J. Mathar, Jan 17 2017
  • PARI
    is_A139819(n)=#Set(digits(n))>1 \\ M. F. Hasler, Sep 08 2015
    
  • Python
    def A139819(n):
        m, k = n, n+9*((l:=len(str(n)))-1)+9*n//(10**l-1)
        while m != k:
            m, k = k, n+9*((l:=len(str(k)))-1)+9*k//(10**l-1)
        return m # Chai Wah Wu, Sep 04 2024

Formula

A202022(a(n)) = 0. - Reinhard Zumkeller, Dec 09 2011

A126071 Number of bases (2 <= b <= n+1) in which n is a palindrome.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 4, 4, 4, 2, 4, 5, 3, 3, 5, 3, 5, 4, 5, 3, 4, 4, 4, 4, 4, 3, 6, 3, 4, 3, 6, 3, 5, 3, 4, 5, 5, 2, 6, 3, 5, 5, 6, 2, 5, 5, 5, 5, 3, 3, 7, 3, 4, 6, 5, 6, 5, 4, 5, 3, 5, 3, 7, 4, 4, 4, 4, 3, 7, 2, 8, 4, 5, 3, 7, 6, 4, 3
Offset: 1

Views

Author

Paul Richards, Mar 01 2007

Keywords

Comments

a(n) >= 1, since n will always have a single "digit" in base n+1.

Examples

			From bases 2 to 9 respectively, 8 can be represented as: 1000, 22, 20, 13, 12, 11, 10, 8. Three of those are symmetrical (22, 11, 8) and so a(8) = 3.
		

Crossrefs

Cf. A016026.
Cf. A016038, A047811 (related to numbers having 2 bases).

Programs

Extensions

Extended by T. D. Noe, Oct 04 2012

A123586 Numbers that are not palindromes of 3 or more digits in some base b >= 2.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 11, 12, 14, 18, 19, 22, 24, 30, 32, 35, 39, 44, 47, 48, 53, 54, 58, 60, 66, 69, 70, 75, 76, 77, 79, 84, 87, 90, 94, 95, 96, 102, 103, 106, 108, 110, 115, 116, 120, 132, 134, 137, 139, 140, 143, 147, 149, 152, 158, 159, 163, 167, 168, 174, 175, 176
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A114255 (complement), A016038.
Showing 1-10 of 21 results. Next