# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a048268
Showing 1-1 of 1
%I A048268 #39 Jun 30 2019 10:39:52
%S A048268 6643,10,46,67,92,121,154,191,232,277,326,379,436,497,562,631,704,781,
%T A048268 862,947,1036,1129,1226,1327,1432,1541,1654,1771,1892,2017,2146,2279,
%U A048268 2416,2557,2702,2851,3004,3161,3322,3487,3656,3829,4006,4187,4372,4561
%N A048268 Smallest palindrome greater than n in bases n and n+1.
%C A048268 From _A.H.M. Smeets_, Jun 19 2019: (Start)
%C A048268 In the following, dig(expr) stands for the digit that represents the value of expression expr, and . stands for concatenation.
%C A048268 As for the naming of this sequence, the trivial 1 digit palindromes 0..dig(n-1) are excluded.
%C A048268 If a number m is palindromic in bases n and n+1, then m has an odd number of digits when represented in base n.
%C A048268 All three digit numbers in base n, that are palindromic in bases n and n+1 are given by:
%C A048268 101_3 22_4 for n = 3,
%C A048268 232_n 1.dig(n).1_(n+1)
%C A048268 343_n 2.dig(n-1).2_(n+1)
%C A048268 up to and including
%C A048268 dig(n-2).dig(n-1).dig(n-2)_n dig(n-3).4.dig(n-3)_(n+1) for n > 3, and
%C A048268 dig(n-1).0.dig(n-1)_n dig(n-3).5.dig(n-3)_(n+1) for n > 4.
%C A048268 Let d_L(n) be the number of integers with L digits in base n (L being odd), being palindromic in bases n and n+1, then:
%C A048268 d_1(n) = n for n >= 2 (see above),
%C A048268 d_3(n) = n-2 for n >= 5 (see above),
%C A048268 d_5(n) = n-1 for n >= 7 and n == 1 (mod 3),
%C A048268 d_5(n) = n-4 for n >= 7 and n in {0, 2} (mod 3), and
%C A048268 it seems that d_7(n) is of order O(n^2*log(n)) for n large enough. (End)
%H A048268 Colin Barker, Table of n, a(n) for n = 2..1000
%H A048268 Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
%F A048268 a(n) = 2n^2 + 3n + 2 for n >= 4 (which is 232_n and 1n1_(n+1)).
%F A048268 a(n) = A130883(n+1) for n > 3. - _Robert G. Wilson v_, Oct 08 2014
%F A048268 From _Colin Barker_, Jun 30 2019: (Start)
%F A048268 G.f.: x^2*(6643 - 19919*x + 19945*x^2 - 6684*x^3 + 19*x^4) / (1 - x)^3.
%F A048268 a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>6.
%F A048268 (End)
%e A048268 a(14) = 2*14^2 + 3*14 + 2 = 436, which is 232_14 and 1e1_15.
%t A048268 Do[ k = n + 2; While[ RealDigits[ k, n + 1 ][ [ 1 ] ] != Reverse[ RealDigits[ k, n + 1 ][ [ 1 ] ] ] || RealDigits[ k, n ][ [ 1 ] ] != Reverse[ RealDigits[ k, n ][ [ 1 ] ] ], k++ ]; Print[ k ], {n, 2, 75} ]
%t A048268 palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; f[n_] := Block[{k = n + 2}, While[ !palQ[k, n] || !palQ[k, n + 1], k++ ]; k]; Table[ f[n], {n, 2, 48}] (* _Robert G. Wilson v_, Sep 29 2004 *)
%o A048268 (PARI) isok(j, n) = my(da=digits(j,n), db=digits(j,n+1)); (Vecrev(da)==da) && (Vecrev(db)==db);
%o A048268 a(n) = {my(j = n); while(! isok(j, n), j++); j;} \\ _Michel Marcus_, Nov 16 2017
%o A048268 (PARI) Vec(x^2*(6643 - 19919*x + 19945*x^2 - 6684*x^3 + 19*x^4) / (1 - x)^3 + O(x^50)) \\ _Colin Barker_, Jun 30 2019
%Y A048268 Cf. A029965, A029966, A048269, A060792, A097928, A097929, A097930, A097931, A099145, A099146, A099147, A099153.
%K A048268 nonn,easy,base
%O A048268 2,1
%A A048268 Ulrich Schimke (ulrschimke(AT)aol.com)
%E A048268 More terms from _Robert G. Wilson v_, Aug 14 2000
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE