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.

A088797 Numbers n > 2 such that n divides the concatenation of n-2 and n-1.

This page as a plain text file.
%I A088797 #47 Jun 08 2025 16:15:42
%S A088797 3,7,67,667,6667,66667,666667,2857143,6666667,66666667,666666667,
%T A088797 1052631579,6666666667,66666666667,666666666667,2857142857143,
%U A088797 6666666666667,11764705882353,66666666666667,666666666666667
%N A088797 Numbers n > 2 such that n divides the concatenation of n-2 and n-1.
%C A088797 For a 10-digit number, the difference between cat((n+2),(n+1)) and cat((n-2),(n-1)) is 40000000002 (as long as n-2 to n+2 are all numbers with the same number of digits). This difference has only 3 divisors which are ten digits long (1052631579, 2105263158 and 6666666667) of which two belong to the sequence. As 40000000002 has no other 10-digit factors, it is necessary to consider 11-digit numbers to obtain more terms.
%C A088797 From _Robert G. Wilson v_, Oct 21 2003, Oct 28 2003, Sep 23 2015 & Oct 24 2015: (Start)
%C A088797 All numbers of the forms
%C A088797 2(10^n-1)/3 + 1,
%C A088797 floor(2(10^(6n + 1) - 1)/7 + 1),
%C A088797 floor(2(10^(16n - 2) - 1)/17 + 1), and
%C A088797 floor(2(10^(18n - 8) - 1)/19 + 1), for n > 0 are members.
%C A088797 The only term not one of the above forms so far is 3. But it is included when n=0 for the second form.
%C A088797 (End)
%C A088797 If numbers less than 3 are acceptable, then an argument could be made that 1 is a terms since cat(n-2,n-1) is -10 which is == 0 (mod 1). - _Robert G. Wilson v_, Sep 29 2015
%C A088797 From _Robert Israel_, Oct 18 2015: (Start)
%C A088797 Numbers n of the form (2*10^m + 1)/k where k = 3, or k = 7 and m == 1 mod 6, or k = 17 and m == 14 mod 16, or k = 19 and m == 10 mod 18.
%C A088797 This is because n | (n-2)*10^m + (n-1) iff n | 2*10^m + 1.
%C A088797 But since we need 10^m >= n > 10^(m-1), 2*10^m+1 = k*n where 3 <= k <= 20.
%C A088797 The only numbers in that range that ever divide 2*10^m+1 are 3,7,17,19. (End)
%H A088797 Robert Israel, <a href="/A088797/b088797.txt">Table of n, a(n) for n = 1..1285</a> (n = 1..104 from Robert G. Wilson v)
%e A088797 a(2)=7 because (7-2) concatenated with (7-1) yields 56 and 7 is a divisor of 56.
%e A088797 a(4)=667 because 667 is a divisor of 665666.
%e A088797 .
%p A088797 M:= 20: # to get all terms with <= M digits
%p A088797 select(type, [seq(seq((2*10^m+1)/k, k=[19,17,7,3]),m=1..M)],integer); # _Robert Israel_, Oct 18 2015
%t A088797 Select[ Range[8250000000], Mod[ FromDigits[ Join[ IntegerDigits[ # - 2], IntegerDigits[ # - 1]]], # ] == 0 &]
%t A088797 fQ[n_] := Mod[ FromDigits[ Join[ IntegerDigits[n - 2], IntegerDigits[n - 1]]], n] == 0; k = 1; lst = {}; Select[ Flatten@ Table[ Select[ Divisors[4*10^n + 2], 10^(n - 1) < # < 10^n &], {n, 15}], fQ] (* _Robert G. Wilson v_, Sep 05 2015 *)
%o A088797 (PARI) for(n=3, 1e6, if((k=eval(Str(n-2,n-1))) && k % n == 0, print1(n", "))) \\ _Altug Alkan_, Sep 25 2015
%Y A088797 Cf. A069860, A069862, A069871, A088798.
%K A088797 base,nonn
%O A088797 1,1
%A A088797 _Chuck Seggelin_, Oct 18 2003
%E A088797 Extended by _Robert G. Wilson v_, Oct 21 2003
%E A088797 Further terms from _Chuck Seggelin_, Oct 29 2003