[go: up one dir, main page]

login
Search: a050812 -id:a050812
     Sort: relevance | references | number | modified | created      Format: long | short | data
Strictly non-palindromic numbers: n is not palindromic in any base b with 2 <= b <= n-2.
+10
22
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,3
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.
LINKS
R. K. Guy, Conway's RATS and other reversals, Amer. Math. Monthly, 96 (1989), 425-428.
John P. Linderman, Perl program [Use the command: HASNOPALINS=1 palin.pl]
FORMULA
a(n) = A047811(n-4) for n > 4. - M. F. Hasler, Sep 08 2015
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 *)
PROG
(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
KEYWORD
nonn,base,nice,easy
EXTENSIONS
Extended and corrected by Patrick De Geest, Oct 15 1999
Edited by N. J. A. Sloane, Apr 09 2008
STATUS
approved
Numbers n not palindromic in any base b, 2 <= b <= 10.
+10
10
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,1
FORMULA
A050812(n) = 0.
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 *)
CROSSREFS
Cf. A214423, A214424, A214425, A214426 (palindromic in 1-4 bases).
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Oct 15 1999
STATUS
approved
Numbers n >= 4 that are not palindromic in any base b, 2 <= b <= n/2.
+10
9
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,1
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
LINKS
R. K. Guy, Conway's RATS and other reversals, Amer. Math. Monthly, 96 (1989), 425-428.
FORMULA
a(n) = A016038(n+4) for all n. - M. F. Hasler, Sep 08 2015
MATHEMATICA
Select[Range[4, 1500], And@@(#!=Reverse[#]&/@Table[IntegerDigits[#, b], {b, 2, #/2}])&] (* Harvey P. Dale, May 22 2013 *)
PROG
(PARI) is(n)=!for(b=2, n\2, Vecrev(d=digits(n, b))==d&&return)&&n>3 \\ M. F. Hasler, Sep 08 2015
CROSSREFS
KEYWORD
nonn,base,easy,nice
EXTENSIONS
Extended (and corrected) by Patrick De Geest, Oct 15 1999
Minor edits by M. F. Hasler, Sep 08 2015
STATUS
approved
Numbers n palindromic in only one base b, 2 <= b <= 10.
+10
9
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,1
COMMENTS
The base for which n is a palindrome is given in A214427.
FORMULA
A050812(n) = 1.
EXAMPLE
11 is palindromic only in base 10.
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
CROSSREFS
Cf. A050813, A214424, A214425, A214426 (palindromic in 0, 2-4 bases)
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Jul 18 2012
STATUS
approved
Numbers n palindromic in exactly three bases b, 2 <= b <= 10.
+10
8
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,1
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).
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
EXAMPLE
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
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
CROSSREFS
Cf. A050813, A214423, A214424, A214426 (palindromic in 0-2 and 4 bases).
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Jul 18 2012
STATUS
approved
Numbers that are palindromic in exactly two bases b, 2 <= b <= 10.
+10
7
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,1
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
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
Attila Bérczes and Volker Ziegler, On simultaneous palindromes, arXiv 1403.0787 [math.NT], 2014.
Edray Herber Goins, Palindromes in different bases: a conjecture of J. Ernest Wilkins, Integers, Vol. 9 (2009), A55.
FORMULA
A050812(a(n)) = 2.
EXAMPLE
15 is palindromic in bases 2 and 4: 15 = 1111_2 = 33_4.
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
PROG
(PARI) pal(v)=v==Vecrev(v)
is(n)=sum(b=2, 10, pal(digits(n, b)))==2 \\ Charles R Greathouse IV, Mar 05 2014
CROSSREFS
Cf. A050813, A214423, A214425, A214426 (palindromic in 0-1 and 3-4 bases).
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Jul 18 2012
STATUS
approved
Numbers n palindromic in exactly four bases b, 2 <= b <= 10.
+10
6
8, 121, 373, 786435
OFFSET
1,1
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
FORMULA
A050812(n) = 4.
EXAMPLE
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.
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
CROSSREFS
Cf. A050813, A214423, A214424, A214425 (palindromic in 0-3 bases).
KEYWORD
nonn,base,hard
AUTHOR
T. D. Noe, Jul 18 2012
STATUS
approved
Integers which are palindromes when expressed in more than one base 2 to 10.
+10
0
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 17, 18, 20, 21, 24, 26, 27, 28, 31, 33, 36, 40, 45, 46, 50, 51, 52, 55, 57, 63, 65, 67, 73, 78, 80, 82, 85, 88, 91, 92, 93, 98, 99, 100, 104, 105, 107, 109, 111, 114, 119, 121, 127, 129, 130, 135, 141, 142, 150, 151, 154, 160, 164, 170, 171, 173, 178
OFFSET
1,2
COMMENTS
Sequence is infinite because all integers of the form 4^n-1 are palindromic in bases 2 and 4.
FORMULA
A050812(a(n)) >= 2. - Michael S. Branicky, Aug 02 2024
EXAMPLE
5 is a term since it's palindromic in more than one base: base 2 (101) and base 4 (11).
121 is a term since it's palindromic in base 3 (11111) and base 7 (232), and also in fact in bases 8 and 10.
MATHEMATICA
q[n_] := Count[Range[2, 10], _?(PalindromeQ[IntegerDigits[n, #]] &)] > 1; Select[Range[180], q] (* Amiram Eldar, Jul 20 2024 *)
PROG
(Python)
from sympy.ntheory import is_palindromic
def ok(n):
c = 0
for b in range(2, 11):
c += int(is_palindromic(n, b))
if c > 1: return True
return False
print([k for k in range(1, 180) if ok(k)]) # Michael S. Branicky, Aug 02 2024
(PARI) isok(k) = sum(b=2, 10, my(v=digits(k, b)); v==Vecrev(v)) > 1; \\ Michel Marcus, Aug 03 2024
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Paul Duckett, Jul 11 2024
STATUS
approved

Search completed in 0.012 seconds