OFFSET
2,1
COMMENTS
a(2), a(3), a(4) and a(6) must be found explicitly.
LINKS
Colin Barker, Table of n, a(n) for n = 2..1000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
FORMULA
n even and n >= 8: a(n) = n^2+(n/2+3)*n+1 (which is (1 n/2+3 1) in base n and (1 n/2-2 1) in base n+2).
n odd and n >= 5: a(n) = (n+1)*(n+3)/2 (which is ((n+3)/2 (n+3)/2) in base n and ((n+1)/2 (n+1)/2) in base n+2).
From Colin Barker, Jun 30 2019: (Start)
G.f.: x^2*(5 + 26*x + 6*x^2 - 54*x^3 + 106*x^4 + 46*x^5 - 283*x^6 - 14*x^7 + 259*x^8 - 81*x^10) / ((1 - x)^3*(1 + x)^3).
a(n) = (5 + (-1)^(1 + n) + 2*(5 + (-1)^n)*n + 2*(2 + (-1)^n)*n^2) / 4 for n>6.
a(n) = 3*a(n-2) - 3*a(n-4) + a(n-6) for n>10.
(End)
EXAMPLE
a(15)= (15+3)/2*15+(15+3)/2=144, which is (99) in base 15 and (88) in base 17.
MATHEMATICA
Do[ k = n + 3; While[ RealDigits[ k, n + 2 ][[ 1 ] ] != Reverse[ RealDigits[ k, n + 2 ][[ 1 ] ] ] || RealDigits[ k, n ][[ 1 ] ] != Reverse[ RealDigits[ k, n ][[ 1 ] ] ], k++ ]; Print[ k ], {n, 2, 50} ]
PROG
(PARI) Vec(x^2*(5 + 26*x + 6*x^2 - 54*x^3 + 106*x^4 + 46*x^5 - 283*x^6 - 14*x^7 + 259*x^8 - 81*x^10) / ((1 - x)^3*(1 + x)^3) + O(x^50)) \\ Colin Barker, Jun 30 2019
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Ulrich Schimke (ulrschimke(AT)aol.com)
EXTENSIONS
More terms from Robert G. Wilson v, Aug 15 2000
STATUS
approved