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.

A249647 Numbers n that divide the concatenation of n+1 and n-1.

Original entry on oeis.org

1, 3, 9, 11, 33, 99, 111, 333, 999, 1111, 3333, 9999, 11111, 33333, 99999, 111111, 142857, 333333, 999999, 1111111, 3333333, 9999999, 11111111, 33333333, 99999999, 111111111
Offset: 1

Views

Author

Paolo P. Lava, Nov 03 2014

Keywords

Comments

A069871 is a subset of this sequence.
All the numbers of the form (10^k - 1)/9, (10^k - 1)/3 and (10^k-1) are members.
Any concatenation of 142857 with itself is part of the sequence, too.
All integers of the form (10^d-1)/k where 1 <= k <= 9. - Robert Israel, Jan 06 2016
It appears that equivalent definitions are: (A) Numbers which divide the repunit of the same length, n | R(length(n)). (B) Numbers equal to one or more concatenations of one among {1, 3, 9, 142857}. Is there a proof for this? - M. F. Hasler, Jun 10 2016

Examples

			3 belongs to this sequence as 3 divides 42, 11 belongs to this sequence as 11 divides 1210.
9 belongs to this sequence as 9 divides the concatenation of 10 and 8, i.e., 108.
		

Crossrefs

Cf. A069871.

Programs

  • Maple
    with(numtheory): P:=proc(q) local n;
    for n from 1 to q do if type(((n+1)*10^(ilog10(n-1)+1)+n-1)/n,integer) then print(n);
    fi; od; end: P(10^15);
    # alternative:
    seq(op(select(type, [seq((10^d-1)/k, k=[9,7,3,1])],integer)),d=1..20); # Robert Israel, Jan 06 2016
  • Mathematica
    Select[Range[2, 10^7], Divisible[FromDigits[IntegerDigits[# + 1]~Join~IntegerDigits[# - 1]], #] &] (* Michael De Vlieger, Jan 06 2016 *)
  • PARI
    for(n=1,10^8, s=concat(Str(n+1),Str(n-1));if(!(eval(s)%n),print1(n,", "))) \\ Derek Orr, Nov 03 2014

Formula

a(n) = 1000001*a(n-19) + 1000000*a(n-38). - Robert Israel, Jan 06 2016

Extensions

a(23)-a(25) from Derek Orr, Nov 03 2014