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 10 results.

A106801 Records by number in A037183, by indices in A065531.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 16, 17, 18, 20, 21, 25, 26, 30, 32, 35, 36, 38, 40, 43, 47, 49, 50, 51, 52, 54, 61, 66, 73, 76, 84, 85, 92, 97, 99, 101, 110, 113, 121, 122
Offset: 0

Views

Author

Michael Trott (mtrott(AT)wolfram.com) and Robert G. Wilson v, May 12 2005; extended Jun 06 2005

Keywords

References

  • Michael Trott, The Mathematica Guide Book for Programming, Springer, 2004, page 218.

Crossrefs

Programs

  • Mathematica
    palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[ p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 1}]]; lst = {0, 0}; Do[ If[ Length[ palindromicBases[n]] > lst[[ -1, 1]], AppendTo[lst, {c, n}]], {n, 200000}]; First[ Transpose[ lst]]

A065708 a(n) is the position of A037183(n) in a sorted list of the terms of A037183.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 10, 13, 12, 16, 15, 14, 17, 18, 20, 19, 21, 25, 22, 26, 24, 30, 23, 27, 29, 28, 32, 35, 36, 34, 31, 38, 37, 33, 40, 43, 42, 41, 47, 49, 48, 39, 45, 50, 44, 46, 51, 52, 54, 61, 57, 56, 58, 55, 66, 60, 62, 64, 73, 59, 65, 76, 63
Offset: 1

Views

Author

Naohiro Nomoto, Dec 04 2001

Keywords

Examples

			a(11)=10 because A037183(11)=252 is the 10th largest term in A037181. - _Sean A. Irvine_, Sep 09 2023
		

Crossrefs

Extensions

Name clarified and more terms from Sean A. Irvine, Sep 09 2023

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

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

A107129 Numbers n which are palindromic in more bases b, 1

Original entry on oeis.org

1, 3, 5, 10, 21, 36, 60, 80, 120, 180, 252, 300, 720, 1080, 1440, 1680, 2160, 2520, 3600, 5040, 7560, 9240, 10080, 12600, 15120, 18480, 25200, 27720, 36960, 41580, 45360, 50400, 55440, 83160, 110880, 131040, 166320, 221760, 277200, 332640, 360360
Offset: 0

Views

Author

Michael Trott (mtrott(AT)wolfram.com) and Robert G. Wilson v, May 12 2005

Keywords

Comments

Records by number in A037183, by indices in A065531.
Except for 3, 5 and 21 they are all even and except for the first seven, they are all multiples of twelve.

Examples

			1 has no palindromic representation in bases 2 to n.
3 = 11_2.
5 = 101_2, 11_4.
10 = 101_3, 22_4, 11_9.
21 = 10101_2, 111_4, 33_6, 11_20.
36960 = 5775_19, 3(90)3_97, (176)(176)_209, (168)(168)_219,
(165)(165)_223, (160)(160)_230, (154)(154)_239, (140)(140)_263, (132)(132)_279,
(120)(120)_307, (112)(112)_329, (110)(110)_335, (105)(105)_351, (96)(96)_384,
(88)(88)_419, (84)(84)_439, (80)(80)_461, (77)(77)_479, (70)(70)_527,
(66)(66)_559, (60)(60)_615, (56)(56)_659, (55)(55)_671, (48)(48)_769,
(44)(44)_839, (42)(42)_879, (40)(40)_923, (35)(35)_1055, (33)(33)_1119,
(32)(32)_1154, (30)(30)_1231, (28)(28)_1319, (24)(24)_1539, (22)(22)_1679,
(21)(21)_1759, (20)(20)_1847, (16)(16)_2309, (15)(15)_2463, (14)(14)_2639,
(12)(12)_3079, (11)(11)_3359, (10)(10)_3695, 88_4619, 77_5279, 66_6159, 55_7391,
44_9239, 33_12319, 22_18479, 11_36959.
		

References

  • Michael Trott, The Mathematica GuideBook for Programming, Springer, 2004, page 218.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{s = Floor@ Sqrt[n + 1] - 1, b = 2, c = If[IntegerQ@ Sqrt[n + 1], -2, -1]}, While[b < s + 2, idn = IntegerDigits[n, b]; If[ idn == Reverse@ idn, c++]; b++]; c + Count[ Mod[n, Range@ s], 0]]; f[n_] := 0 /; n < 3;
    k = 0; mx = -1; lst = {}; While[ k < 360000001, c = f@ k; If[ c > mx, AppendTo[lst, k]; mx = c]; k++]; lst

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

A087911 Smallest prime p that is a palindrome in n different bases < p.

Original entry on oeis.org

2, 3, 5, 17, 191, 257, 1009, 4561, 4591, 21601, 57601, 54121, 86677, 176401, 415801, 291721, 950041, 1259701, 3049201, 1670761, 6098401, 3880801, 5654881, 13759201, 18618601, 14414401, 18960481, 15135121, 31600801, 45405361, 35814241
Offset: 1

Views

Author

Randy L. Ekl, Oct 17 2003

Keywords

Comments

a(n) = A000040(A137779^(-1)(n)). - Attila Olah (jolafix(AT)gmail.com), May 06 2008, corrected May 08 2008
The sequence is not monotonic: a(10) > a(11) = 54121. - Attila Olah (jolafix(AT)gmail.com), May 06 2008, corrected May 08 2008

Examples

			a(4) = 191 because 191 base 6 = 515, 191 base 9 = 232, 191 base 10 = 191 and 191 base 190 = 11, all palindromes. No numbers less than 191 can be represented in 4 such ways.
a(12) = 54121 because 54121 is a palindrome in 12 different bases, including base 1 and base 54120.
		

Crossrefs

Programs

  • PARI
    q=1; forprime(m=3,20000,count=0; for(b=2,m-1, w=b+1; k=0; i=m; while(i>0,k=k*w+i%b; i=floor(i/b)); l=0; j=k; while(j>0,l=l*w+j%w; j=floor(j/w)); if(l==k,count=count+1,); if(count>q,print1(m,", "); q=count,)))

Extensions

More terms from David Wasserman, Jun 20 2005
Terms a(17)-a(22) computed by Karl Hovekamp, sent by David Wasserman, Dec 19 2006
More terms from Karl Hovekamp, Jan 01 2007

A092358 Let R_{k}(m) = the digit reversal of m in base k (R_{k}(m) is written in base 10). a(n) is the smallest x such that there are exactly n bases {k} (k >= 2 and (x < y)) solutions of the equation: R_{k}(x) = y and R_{k}(y) = x.

Original entry on oeis.org

5, 11, 47, 67
Offset: 1

Views

Author

Naohiro Nomoto, Mar 18 2004

Keywords

Examples

			a(2)=11 because there are two solutions: R_{3}(11) = 19 and R_{3}(19) = 11, R_{9}(11) = 19 and R_{9}(19) = 11.
		

Crossrefs

A092359 Let R_{k}(m) = the digit reversal of m in base k (R_{k}(m) is written in base 10). a(n) is the smallest y such that there are exactly n bases {k} (k >= 2 and (x < y)) solutions of the equation: R_{k}(x) = y and R_{k}(y) = x.

Original entry on oeis.org

7, 19, 61, 193
Offset: 1

Views

Author

Naohiro Nomoto, Mar 18 2004

Keywords

Examples

			a(2)=19 because there are two solutions: R_{3}(11) = 19 and R_{3}(19) = 11, R_{9}(11) = 19 and R_{9}(19) = 11.
		

Crossrefs

Showing 1-10 of 10 results.