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

A016038 Strictly non-palindromic numbers: n is not palindromic in any base b with 2 <= b <= n-2.

Original entry on oeis.org

0, 1, 2, 3, 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

All elements of the sequence greater than 6 are prime (ab = a(b-1) + a or a^2 = (a-1)^2 + 2(a-1) + 1). Mersenne and Fermat primes are not in the sequence.
Additional comments: if you can factor a number as a*b then it is a palindrome in base b-1, where b is the larger of the two factors. (If the number is a square, then it can be a palindrome in an additional way, in base (sqrt(n)-1)). The a*b form does not work when a = b-1, but of course there are no two consecutive primes (other than 2,3, which explains the early special cases), so if you can factor a number as a*(a-1), then another factorization also exists. - Michael B Greenwald (mbgreen(AT)central.cis.upenn.edu), Jan 01 2002
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
No number n is palindromic in any base b with n/2 <= b <= n-2, so this is also numbers not palindromic in any base b with 2 <= b <= n/2.
Sequence A047811 (this sequence without 0, 1, 2, 3) is mentioned in the Guy paper, 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 18 2011
From Robert G. Wilson v, Oct 22 2014 and Nov 03 2014: (Start)
Define f(n) to be the number of palindromic representations of n in bases b with 1 < b < n, see A135551.
For A016038, f(n) = 1 for all n. Only the numbers n = 0, 1, 4 and 6 are not primes.
For f(n) = 2, all terms are prime or semiprimes (prime omega <= 2 (A037143)) with the exception of 8 and 12;
For f(n) = 3, all terms are at most 3-almost primes (prime omega <= 3 (A037144)), with the exception of 16, 32, 81 and 625;
For f(n) = 4, all terms are at most 4-almost primes, with the exception of 64 and 243;
For f(n) = 5, all terms are at most 5-almost primes, with the exception of 128, 256 and 729;
For f(n) = 6, all terms are at most 6-almost primes, with the sole exception of 2187;
For f(n) = 7, all terms are at most 7-almost primes, with the exception of 512, 2048 and 19683; etc. (End)

References

  • Paul Guinand, Strictly non-palindromic numbers, unpublished note, 1996.

Crossrefs

Programs

  • Mathematica
    PalindromicQ[n_, base_] := FromDigits[Reverse[IntegerDigits[n, base]], base] == n; PalindromicBases[n_] := Select[Range[2, n-2], PalindromicQ[n, # ] &]; StrictlyPalindromicQ[n_] := PalindromicBases[n] == {}; Select[Range[150], StrictlyPalindromicQ] (* Herman Beeksma, Jul 16 2005*)
    palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[ p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 2}]]; lst = {0, 1, 4, 6}; Do[ If[ Length@ palindromicBases@ Prime@n == 0, AppendTo[lst, Prime@n]], {n, 10000}]; lst (* Robert G. Wilson v, Mar 08 2008 *)
    Select[Range@ 1500, Function[n, NoneTrue[Range[2, n - 2], PalindromeQ@ IntegerDigits[n, #] &]]] (* Michael De Vlieger, Dec 24 2017 *)
  • PARI
    is(n)=!for(b=2,n\2,Vecrev(d=digits(n,b))==d&&return) \\ M. F. Hasler, Sep 08 2015
    
  • Python
    from itertools import count, islice
    from sympy.ntheory.factor_ import digits
    def A016038_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n: all((s := digits(n,b)[1:])[:(t:=len(s)+1>>1)]!=s[:-t-1:-1] for b in range(2,n-1)), count(max(startvalue,0)))
    A016038_list = list(islice(A016038_gen(),30)) # Chai Wah Wu, Jan 17 2024

Formula

a(n) = A047811(n-4) for n > 4. - M. F. Hasler, Sep 08 2015

Extensions

Extended and corrected by Patrick De Geest, Oct 15 1999
Edited by N. J. A. Sloane, Apr 09 2008

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
    

A214423 Numbers n palindromic in only one base b, 2 <= b <= 10.

Original entry on oeis.org

11, 12, 13, 14, 22, 23, 25, 29, 30, 32, 34, 35, 37, 38, 41, 42, 43, 44, 48, 49, 54, 56, 59, 60, 61, 62, 64, 66, 68, 70, 71, 72, 74, 77, 81, 83, 86, 89, 97, 101, 112, 113, 117, 118, 123, 124, 125, 126, 128, 131, 136, 138, 145, 146, 148, 153, 156, 157, 161
Offset: 1

Views

Author

T. D. Noe, Jul 18 2012

Keywords

Comments

The base for which n is a palindrome is given in A214427.

Examples

			11 is palindromic only in base 10.
		

Crossrefs

Cf. A050813, A214424, A214425, A214426 (palindromic in 0, 2-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] == 1, AppendTo[t, n]]]; t

Formula

A050812(n) = 1.

A214425 Numbers n palindromic in exactly three bases b, 2 <= b <= 10.

Original entry on oeis.org

9, 10, 21, 40, 55, 63, 65, 80, 85, 100, 130, 154, 164, 178, 191, 195, 203, 235, 242, 255, 257, 273, 282, 292, 300, 325, 328, 341, 400, 455, 585, 656, 819, 910, 2709, 4095, 4097, 4161, 6643, 8200, 12291, 12483, 14762, 20485, 20805, 21525, 21845, 32152, 53235
Offset: 1

Views

Author

T. D. Noe, Jul 18 2012

Keywords

Comments

In the first 1234 terms, only 28 of the possible 84 triples of bases occur. Does every triple occur eventually? - T. D. Noe, Aug 17 2012
See A238893 for the three bases. By far, the most common bases are (2,4,8). - T. D. Noe, Mar 07 2014 (exception are in A260184. - Giovanni Resta and Robert G. Wilson v, Jul 17 2015).

Examples

			10 is palindromic in bases 3, 4, and 9.
273 is in the sequence because 100010001_2 = 101010_3 = 10101_4 = 2043_5 = 1133_6 = 540_7 = 421_8 = 333_9 = 273_10 and three of the bases, namely 2, 4 & 9, yield palindromes. - _Giovanni Resta_ and _Robert G. Wilson v_, Jul 17 2015
		

Crossrefs

Cf. A050813, A214423, A214424, A214426 (palindromic in 0-2 and 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] == 3, AppendTo[t, n]]]; t

Formula

A050812(n) = 3.
The intersection of A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955 & A002113 which yields just three members. - Giovanni Resta and Robert G. Wilson v, Jul 17 2015

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

A214424 Numbers that are palindromic in exactly two bases b, 2 <= b <= 10.

Original entry on oeis.org

15, 16, 17, 18, 20, 24, 26, 27, 28, 31, 33, 36, 45, 46, 50, 51, 52, 57, 67, 73, 78, 82, 88, 91, 92, 93, 98, 99, 104, 105, 107, 109, 111, 114, 119, 127, 129, 135, 141, 142, 150, 151, 160, 170, 171, 173, 182, 185, 186, 200, 209, 212, 215, 219, 227, 246, 252
Offset: 1

Views

Author

T. D. Noe, Jul 18 2012

Keywords

Comments

Every pair of bases occurs. The pair (2,3), for the number a(732) = 1422773, is the last to occur. Note that 1422773 = 101011011010110110101(2) = 2200021200022(3).
See A238338 for the pairs of bases. - T. D. Noe, Mar 07 2014

Examples

			15 is palindromic in bases 2 and 4: 15 = 1111_2 = 33_4.
		

Crossrefs

Cf. A050813, A214423, A214425, A214426 (palindromic in 0-1 and 3-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] == 2, AppendTo[t, n]]]; t
  • PARI
    pal(v)=v==Vecrev(v)
    is(n)=sum(b=2,10,pal(digits(n,b)))==2 \\ Charles R Greathouse IV, Mar 05 2014

Formula

A050812(a(n)) = 2.

A214426 Numbers n palindromic in exactly four bases b, 2 <= b <= 10.

Original entry on oeis.org

8, 121, 373, 786435
Offset: 1

Views

Author

T. D. Noe, Jul 18 2012

Keywords

Comments

Searched up to 10^18. Rick Regan mentions these four numbers, also found by Bill Beckmann, at the end of his webpage. - T. D. Noe, Aug 18 2012

Examples

			8 is palindromic in bases 3, 7, 9, and 10.
121 is palindromic in bases 3, 7, 8, and 10.
373 is palindromic in bases 4, 7, 9, and 10.
786435 is palindromic in bases 2, 4, 7, and 8.
		

Crossrefs

Cf. A050813, A214423, A214424, A214425 (palindromic in 0-3 bases).

Programs

  • Mathematica
    n = -1; t = {}; While[Length[t] < 4, n++; If[Count[Table[s = IntegerDigits[n, m]; s == Reverse[s], {m, 2, 10}], True] == 4, AppendTo[t, n]]]; t

Formula

A050812(n) = 4.

A214422 Least number k > 9 that is palindromic in exactly n bases b, with 2 <= b <= 10.

Original entry on oeis.org

19, 11, 15, 10, 121
Offset: 0

Views

Author

T. D. Noe, Jul 18 2012

Keywords

Comments

There are no other terms < 10^12. The ultimate goal is to find (probably a very large) k that is palindromic in all 9 bases 2 to 10.

Examples

			19 is not palindromic in bases 2 to 10.
11 is palindromic in base 10.
15 is palindromic in bases 2 and 4.
10 is palindromic in bases 3, 4, and 9.
121 is palindromic in bases 3, 7, 8, and 10.
		

Crossrefs

Cf. A050813, A214423, A214424, A214425, A214426 (palindromic in 0-4 bases).
Showing 1-9 of 9 results.