login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A016038 Strictly non-palindromic numbers: n is not palindromic in any base b with 2 <= b <= n-2. 21

%I #78 Jan 18 2024 08:56:54

%S 0,1,2,3,4,6,11,19,47,53,79,103,137,139,149,163,167,179,223,263,269,

%T 283,293,311,317,347,359,367,389,439,491,563,569,593,607,659,739,827,

%U 853,877,977,983,997,1019,1049,1061,1187,1213,1237,1367,1433,1439,1447,1459

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

%C 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.

%C 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 ab 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

%C 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

%C 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.

%C 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

%C From _Robert G. Wilson v_, Oct 22 2014 and Nov 03 2014: (Start)

%C Define f(n) to be the number of palindromic representations of n in bases b with 1 < b < n, see A135551.

%C For A016038, f(n) = 1 for all n. Only the numbers n = 0, 1, 4 and 6 are not primes.

%C For f(n) = 2, all terms are prime or semiprimes (prime omega <= 2 (A037143)) with the exception of 8 and 12;

%C 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;

%C For f(n) = 4, all terms are at most 4-almost primes, with the exception of 64 and 243;

%C For f(n) = 5, all terms are at most 5-almost primes, with the exception of 128, 256 and 729;

%C For f(n) = 6, all terms are at most 6-almost primes, with the sole exception of 2187;

%C For f(n) = 7, all terms are at most 7-almost primes, with the exception of 512, 2048 and 19683; etc. (End)

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

%H T. D. Noe, <a href="/A016038/b016038.txt">Table of n, a(n) for n = 1..10001</a>

%H K. S. Brown, <a href="http://www.mathpages.com/home/kmath359.htm">On General Palindromic Numbers</a>

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/nobase10.htm">Palindromic numbers beyond base 10</a>

%H R. K. Guy, <a href="http://www.jstor.org/stable/2325149">Conway's RATS and other reversals</a>, Amer. Math. Monthly, 96 (1989), 425-428.

%H John P. Linderman, <a href="/A135549/a135549.html">Description of A135549-A016038</a>

%H John P. Linderman, <a href="/A135549/a135549.txt">Perl program</a> [Use the command: HASNOPALINS=1 palin.pl]

%F a(n) = A047811(n-4) for n > 4. - _M. F. Hasler_, Sep 08 2015

%t 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*)

%t 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 *)

%t Select[Range@ 1500, Function[n, NoneTrue[Range[2, n - 2], PalindromeQ@ IntegerDigits[n, #] &]]] (* _Michael De Vlieger_, Dec 24 2017 *)

%o (PARI) is(n)=!for(b=2,n\2,Vecrev(d=digits(n,b))==d&&return) \\ _M. F. Hasler_, Sep 08 2015

%o (Python)

%o from itertools import count, islice

%o from sympy.ntheory.factor_ import digits

%o def A016038_gen(startvalue=0): # generator of terms >= startvalue

%o 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)))

%o A016038_list = list(islice(A016038_gen(),30)) # _Chai Wah Wu_, Jan 17 2024

%Y Cf. A047811, A050812, A050813, A037183, A135550, A135551, A135549, A138348.

%K nonn,base,nice,easy

%O 1,3

%A _Robert G. Wilson v_

%E Extended and corrected by _Patrick De Geest_, Oct 15 1999

%E Edited by _N. J. A. Sloane_, Apr 09 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 04:56 EDT 2024. Contains 371767 sequences. (Running on oeis4.)