A016038 Strictly non-palindromic numbers: n is not palindromic in any base b with 2 <= b <= n-2.
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
References
- Paul Guinand, Strictly non-palindromic numbers, unpublished note, 1996.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10001
- K. S. Brown, On General Palindromic Numbers
- Patrick De Geest, Palindromic numbers beyond base 10
- R. K. Guy, Conway's RATS and other reversals, Amer. Math. Monthly, 96 (1989), 425-428.
- John P. Linderman, Description of A135549-A016038
- John P. Linderman, Perl program [Use the command: HASNOPALINS=1 palin.pl]
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
Comments