OFFSET
1,2
COMMENTS
If n+1 has k digits, the concatenation is 10^k n + n + 1, which is
congruent to n (10^k - 1) mod 2n+1. Since n and 2n+1 are coprime,
the condition is just that 2n+1 divides 10^k - 1. Now n+1 having k
digits means 10^(k-1) <= n+1 <= 10^k - 1, so d = (10^k-1)/(2n+1) can only
be 1, 2, 3, 4 or 5. But it can't be 2, 4 or 5 because 10^k - 1 is
not divisible by 2 or 5. The case d=1 corresponds to n = 5*10^(k-1) - 1
(thus 4, 49, 499, ...) and the case d=3 corresponds to n = (10^k-4)/6
(thus 1, 16, 166, 1666, ...). [Robert Israel]
REFERENCES
Eric Angelini, Posting to the Sequence Fans Mailing List, Sep 21 2010
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,11,0,-10).
FORMULA
From Wesley Ivan Hurt, Apr 30 2016: (Start)
G.f.: x*(1 + 4 x + 5 x^2 + 5 x^3)/(1 - 11 x^2 + 10 x^4).
a(n) = 11*a(n-2) - 10*a(n-4) for n>4.
a(n) = (10^((n+1)/2)-4)*(1-(-1)^n)/12 + (10^(n/2)-2)*(1+(-1)^n)/4. (End)
E.g.f.: (3 - 6*cosh(x) + 3*cosh(sqrt(10)*x) - 4*sinh(x) + sqrt(10)*sinh(sqrt(10)*x))/6. - Stefano Spezia, Aug 04 2024
EXAMPLE
1+2 divides 12 -> 12/3 = 4;
4+5 divides 45 -> 45/9 = 5;
16+17 divides 1617 -> 1617/33 = 49;
49+50 divides 4950 -> 4950/99 = 50;
166+167 divides 166167 -> 166167/333 = 499.
MAPLE
A173712:=n->(10^((n+1)/2)-4)*(1-(-1)^n)/12+(10^(n/2)-2)*(1+(-1)^n)/4: seq(A173712(n), n=1..40); # Wesley Ivan Hurt, Apr 30 2016
MATHEMATICA
CoefficientList[Series[(1 + 4 x + 5 x^2 + 5 x^3)/(1 - 11 x^2 + 10 x^4), {x, 0, 30}], x] (* Wesley Ivan Hurt, Apr 30 2016 *)
LinearRecurrence[{0, 11, 0, -10}, {1, 4, 16, 49}, 50] (* G. C. Greubel, Nov 24 2016 *)
PROG
(PARI) for(n=1, 99999, eval(Str(n, n+1))%(1+2*n) || print1(n, ", ")) \\ M. F. Hasler
(Magma) [(10^((n+1) div 2)-4)*(1-(-1)^n)/12+(10^(n div 2)-2)*(1+(-1)^n)/4 : n in [1..30]]; // Wesley Ivan Hurt, Apr 30 2016
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
N. J. A. Sloane, Nov 25 2010
STATUS
approved