OFFSET
1,2
COMMENTS
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Eric Angelini (and reply by M. Hasler), 3, 29, 289, 321, ..., SeqFan list, Feb. 13, 2016
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,-1).
FORMULA
G.f.: x*(1 +19*x +29*x^2 +13*x^3 +49*x^4 +59*x^5 +23*x^6 +79*x^7 +89*x^8 +9*x^9 +71*x^10 +61*x^11 +17*x^12 +41*x^13 +31*x^14 +7*x^15 +11*x^16 +x^17) / ((1 -x)^2*(1 +x +x^2)^2*(1 +x^3 +x^6)^2). - Colin Barker, Feb 15 2016 and Feb 22 2016
a(n) = 2*a(n-9)-a(n-18) for n>18. - Colin Barker, Feb 15 2016
a(n) = if n mod 9 == 1 then (n-1)/9*10+1 else if n mod 3 == 1 then (n-1)/3*10+3 else n*10-1, cf. SeqFan post for the proof. This implies the above recurrence relation and generating function. - M. F. Hasler, Feb 15 2016
MATHEMATICA
Table[SelectFirst[Range@ 1000, # == n Mod[#, 10] + Floor[#/10] &], {n,
55}] (* Version 10, or *)
Table[k = 1; While[k != n Mod[k, 10] + Floor[k/10], k++]; k, {n, 55}] (* Michael De Vlieger, Feb 15 2016 *)
PROG
(PARI) A268488(n)=if(n%9==1, n\9*10+1, if(n%3==1, n\3*10+3, n*10-1))
(PARI) a(n) = k=1; while(k != n*(k%10)+k\10, k++); k
vector(100, n, a(n)) \\ Colin Barker, Feb 15 2016
(PARI) Vec(x*(1 +19*x +29*x^2 +13*x^3 +49*x^4 +59*x^5 +23*x^6 +79*x^7 +89*x^8 +9*x^9 +71*x^10 +61*x^11 +17*x^12 +41*x^13 +31*x^14 +7*x^15 +11*x^16 +x^17) / ((1 -x)^2*(1 +x +x^2)^2*(1 +x^3 +x^6)^2) + O(x^40)) \\ Colin Barker, Feb 22 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler, Feb 14 2016
STATUS
approved